Helpful Information
 
 
Category: Flash Help
goto a frame based on a variable

I have a movie clip which I want to go to a certain frame based on a var on the mail time line.

I put this script action into a key frame in the 1st frame on the clip timeline:

if (_root.v1=a) {
gotoAndStop ("a");
}


if the var a on the main time line equals a then goto frame label a on the clip...

Where did I go wrong? this does not work

Thanks

I think you mean:

if(_root.v1 == a)


_root.v1 = a sets _root.v1 to a

_root.v1 == a checks of they are equal.

Thanks Jeff, the whole actionscript thing is new to me. I was able to achive my goal by labeling the frames with the possible variable inputs. Then it was a simple:

gotoAndStop (_root.varname);










privacy (GDPR)