all groups > flash actionscript > november 2004 >
You're in the

flash actionscript

group:

gotoAndPlay


gotoAndPlay knucklenutz
11/19/2004 10:37:42 PM
flash actionscript:
Hi, I am encountering a weird occurance with the gotoAndPlay action. When I
load an external swf into a target clip, I am trying to tell the movie to go to
a specific frame label based on a variable - gotoAndPlay('scene_' + variable);
Each scene begins with a label such as scene_1, scene_2, etc. On loading the
movie the script to gotoAndPlay the appropriate label seems to be failing and
it always plays scene_1, even though debugging has shown that the variable is
clearly not 1. Has anyone had any problems using the gotoAndPlay action across
multiple scenes? Thanks.
Re: gotoAndPlay NSurveyor
11/19/2004 11:35:21 PM
For your gotoAndPlay() to work, what goes between the '(' and the ')' can't
have addition, subtraction, multiplication, division, or other things. So,
first declare a variable with the value of 'scene_'+variable and then
gotoAndPlay that variable. For example: gotoframe =
'scene_'+Math.floor(Math.random()*10)+1; gotoAndPlay(gotoframe); Just curious -
how did you get the Author Icon?
Re: gotoAndPlay knucklenutz
11/20/2004 12:06:47 AM
Thanks for the tip! Unfortunately this didn't work. What is even more weird,
I only encounter this problem when viewing the SWF through a browser. Locally
it works fine and dandy. What is even more weird, I have buttons that jump to
different scenes, and they don't work on the first click, but they work on
subsequent clicks. Again, only through the browser. I fear something else in
the file is causing the weirdness. As for the Author icon, I don't know how I
got that or even what it means. Cheers!
Re: gotoAndPlay Jeckyl
11/22/2004 9:25:35 AM
[quoted text, click to view]

That is just plain incorrect.

AddThis Social Bookmark Button