Page 1 of 1
Scripting help needed... switching layers?
Posted: Tue Jul 11, 2006 7:51 pm
by AndrewWickliffe
Is it possible to get the layer # of an object and use it in scripting.
Or, simplier, is it possible to switch the layers of a couple objects?
TIA
Posted: Tue Jul 11, 2006 8:28 pm
by malte
Hi,
you are almost there.
script snippets:
get the layer of btn "myButton"
set the layer of grc "myGraphic" to 1
set the layer of img "myImage" to the number of layers
Hope that helps,
Malte
Posted: Tue Jul 11, 2006 8:33 pm
by AndrewWickliffe
Thanks.
if I use the "get the layer" command, can I save that data so I can set another image to that layer?
get the layer of btn "myButton"
(new command here)
set the layer of btn "myNewButton" to (the result of that command)
Thanks again,
Andrew
Posted: Tue Jul 11, 2006 8:47 pm
by malte
If you use get the result is stored in the it variable.
get the layer of btn "myButton"
set the layer of btn "myOtherButton" to it
You could also use a temporary var like this.
put the layer of btn "myButton" into tOldLayer
set the layer of btn "myOtherButton" to tOldLayer
All the best,
Malte
Posted: Tue Jul 11, 2006 8:50 pm
by AndrewWickliffe
great, thanks!