Groups | Blog | Home
all groups > flash (macromedia) > may 2004 >

flash (macromedia) : gotoAndStop(variable+1)


NSurveyor
5/21/2004 10:37:34 PM
I'm trying to do this:
_root.mshow.gotoAndStop(_root.moonrotation+1);
This is supposed to make a movieclip, mshow goto and stop at the frame with
the value of a contantly changing variable + 1.
I'm pretty sure when using gotoAndStop(), you can't have a variable. i don't
want to do this:

if (_root.moonrotion+1==1) {
_root.mshow.gotoAndStop(1);
} else if (_root.moonrotion+1==2) {
_root.mshow.gotoAndStop(3);
and so on...

I don't want to use ifs because moonrotation has 361 possible values. So, I
was wondering if anyone knew how to get gotoandstop to goto a frame with the
value of a variable.


Shan-Dysigns
5/21/2004 10:44:04 PM
frame_number=Math.round(_root.moonrotation+1); // you won't need Math.round if your moonrotation variable will ONLY be incresed by whole numbers //
AddThis Social Bookmark Button