Groups | Blog | Home
all groups > flash actionscript > april 2007 >

flash actionscript : variable IF inside mc


Peter Hahmann
4/19/2007 6:39:15 PM
Hi,

I have the following question:

I have 5 buttons inside a movie clip and i would like to work with the
variable IF.

For example, if the button 1 is released it plays the main timeline and after
finishing, tru the variable if, the timeline is redirected to a frame x.

i'm sorry if i haven't expressed me well because my english is not one of the
best.

As of button 1:

on(release){
_root.play();
bt="teste"
}


As of the last frame of the main timeline

if(bt=="teste"){
gotoAndPlay(233);
}


if the button is direcly placed on the stage the variable IF works normaly,
but when the button is inside a mc the _root.play(); action is normal but the
variable IF is simply ignored by the time line, and the timeline is not
redirected to frame 233.

could someone help me?
thanks,
Peter
MotionMaker
4/19/2007 6:53:44 PM
You need to declare bt outside the on code block. Do this on the first key frame
var bt:String;
or
var bt:String = "";
Peter Hahmann
4/20/2007 8:32:47 PM
sorry but i didn't get it, could you be more specific, " declaring for dummies"!

AddThis Social Bookmark Button