Groups | Blog | Home
all groups > flash actionscript > march 2004 >

flash actionscript : HELP! Flash goto's - low priority?


mr.tibbs
3/12/2004 11:09:58 PM
If someone could provide an explanation for this behaviour, that would be
absolutely fantastic:

Follow these steps:
1) Open a new Flash Document
2) On Frame 1, open the ActionScript panel and type this in:

function deferredGoto()
{
gotoAndPlay( 5 );
trace( "frame 1 trace" );
}

deferredGoto();

3) Place a keyframe on frame 5 of the Timeline, and open the ActionScript
panel for that frame. Type this in:

trace( "frame 5 trace" );
stop();

4) Test your movie. You should see:

frame 1 trace
frame 5 trace

My question is why does Flash prioritize goto's lower than other ActionScript?
If this was not the case, the frame 5 trace would been seen first.
pazzoboy
3/13/2004 2:15:52 AM
You have called a function in the first frame that has a command to goto a
frame that hasn't loaded yet. If you put an if statement (if
framesloaded==totalframes) in frame 1 that must be met before the
gotoAndPlay(5) is executed, it'll work.
Peter Blumenthal
3/15/2004 10:55:07 AM
[quoted text, click to view]


I'm sorry, but that's just plain wrong. Easy to test. If you take mr.tibbs'
example and move frame 1 to frame 10 (meaning frame 5 MUST be loaded first)
you will see that exactly the same thing happens.

--
---------------------------------------
http://www.phageinteractive.com
PhageInteractive Ltd.
remove mm_ to mail
---------------------------------------
'I wish we lived in a world where it was possible to be religious and think
at the same time.' - Jonh Graves

AddThis Social Bookmark Button