Indigo Rose Software

Go Back   Indigo Rose Software Forums > Old Versions > AutoPlay Media Studio 6.0

Reply
 
Thread Tools Display Modes
  #1  
Old 09-16-2005
yosik's Avatar
yosik yosik is offline
Indigo Rose Customer
 
Join Date: Jun 2002
Location: Israel
Posts: 1,863
Use of variables for object definition (not name)

Is it possible to do that?
I"ll explain:
I have one image (Image1) and one Button (Button1) on the page.
Based on a given event, I want to influence one object or the other with something like that:

objectdef = "Image"

objectdef.setpos (......)

Thanks
Yossi
Reply With Quote
  #2  
Old 09-16-2005
TJ_Tigger's Avatar
TJ_Tigger TJ_Tigger is offline
Indigo Rose Customer
 
Join Date: Sep 2002
Location: Sol 3
Posts: 3,188
Yes you can do that. Since the SetPos actions are the same from one object to another you can determine what type of object you are dealing with, set a variable to be that object type and then execute the SetPos Action.
Code:
Object = nil;
if ObjectType == "OBJECT_IMAGE" then
    Object = Image;  --no quotes around the word image
    --What this does is set the Object variable to the Image table which 
    --defines all of the Image actions.  Cool huh
elseif ObjectType == "OBJECT_BUTTON" then
    Object = Button;
end
if Object then
    Object.SetPos(sName, x, y)
end
__________________
TJ-Tigger
"A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
"Draco dormiens nunquam titillandus."
Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine
Reply With Quote
  #3  
Old 09-16-2005
TJ_Tigger's Avatar
TJ_Tigger TJ_Tigger is offline
Indigo Rose Customer
 
Join Date: Sep 2002
Location: Sol 3
Posts: 3,188
Here is a larger chunk of code showing the above

Code:
local tblObjects = Page.EnumerateObjects()
local Object = nil;
	
--if there are objects on the page
if tblObjects then
	for index, CurrentObject in tblObjects do
		--check for object type, 
		if Page.GetObjectType(CurrentObject) == OBJECT_FLASH then
			Object = Flash;
		elseif Page.GetObjectType(CurrentObject) == OBJECT_INPUT then
			Object = Input;
		elseif Page.GetObjectType(CurrentObject) == OBJECT_VIDEO then
			Object = Video;
		elseif Page.GetObjectType(CurrentObject) == OBJECT_WEB then
			Object = Web;
		end
	
		if Object then
			tblPos = Object.GetPos(CurrentObject)
			tblSize = Object.GetSize(CurrentObject)
			Object.SetEnabled(CurrentObject, false)
			Object.SetEnabled(CurrentObject, true)
		end
	end
end
__________________
TJ-Tigger
"A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
"Draco dormiens nunquam titillandus."
Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine
Reply With Quote
  #4  
Old 09-16-2005
Eagle Eagle is offline
Indigo Rose Customer
 
Join Date: Mar 2005
Location: WA 'wait a while' - Australia
Posts: 827
tks for the code TJ ..
Reply With Quote
  #5  
Old 09-16-2005
Desmond's Avatar
Desmond Desmond is offline
Indigo Rose Staff Member
 
Join Date: Jul 2003
Posts: 628
I think adam's sample resize project makes use of this technique.
__________________
Setup Factory 8.0 comes with over 250 actions so you can create smaller, faster and more intelligent software installers than ever before.

WebHelp Guides: AMS | MSIFACT | SUF | TU | VP
Reply With Quote
  #6  
Old 09-17-2005
yosik's Avatar
yosik yosik is offline
Indigo Rose Customer
 
Join Date: Jun 2002
Location: Israel
Posts: 1,863
GREAT TJ. Thanks a bunch for that

Yossi
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Passing Variables ianhull Developer's Den 4 07-06-2005 05:10 AM
Variables in message dialogs now broken? Tek Setup Factory 7.0 Discussion 2 03-14-2005 03:09 AM
Help passing screen variables swilk Setup Factory 7.0 Discussion 2 12-06-2004 12:07 PM
INFO: Setting Environment Variables Support Setup Factory 6.0 Knowledge Base 0 10-10-2002 01:07 PM


All times are GMT -6. The time now is 04:40 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software