PDA

View Full Version : using variables in script actions



j0se
June 4th, 2002, 07:34 AM
hi again,

i'm trying to execute the following from a function:

===
function play_scene (scene_name) {
&nbsp &nbsp &nbsp &nbsp _root.scene_name.play("start");
}
===

scene_name is a variable that i'm passing from a button

e.g
'about us' button code:
on (release) {
&nbsp &nbsp &nbsp &nbsp _root.play_scene("about_us");
}

the about_us mc is on the main time line and has the instance name: about_us, so i'm assuming the problem is in the function code/syntax

thanks in advance for looking at this
:)

ilyaslamasse
June 4th, 2002, 07:53 AM
I don't understand. Is the argument a scene or a mc ? If it's an mc, you could try
function play_scene (scene_name) {

_root[scene_name].play("start" ) ;

}pom 0]

j0se
June 5th, 2002, 02:13 AM
sorry about that: i confused matters by calling the function 'play_scene'. you're correct in your second assumption: the argument is a mc (the function plays a mc, not a scene - i'll have to name these things better in future...

i will try your code asap

thanks!
:)