PDA

View Full Version : skipping frame in script?


atbonner
08-07-2001, 11:14 PM
I have a main movie, which contains 4 clips that load in different sub-movie on request from the main navigation. To accomplish this, I have a routine, containing multiple frames, that i call from several points in a movie. Sometimes it works, and sometimes it doesn't. Using the "trace" action, it seems that a certain frame is being skipped sometimes. Anyone have suggestions? I am workin in Flash 5, publishing as Flash 4, if that makes a difference.

Here's how it works (slightly abbreviated):

a button (actually several buttons, some of which consistently work fine, others which consistently fail)has the action:
TellTarget ("refresh"){
gotoAndPlay ("refreshAll")
}

The corresponding movie clip "refresh" has the following:

frame 1 (labeled refreshAll):
if (_level0:S eq "small){
loadMovie ("small.swf", "/small")
}

frame 2- "start" is a blank frame at the beginning of each clip:
if (level0:S eq "small"){
tellTarget ("/medium"){
gotoAndStop ("start")
}
tellTarget ("/large"){
gotoAndStop ("start")
}
tellTarget ("/small"){
gotoAndPlay ("play")
}
frame 3-
plays several different clips within the selected clip, execpt of course, when frame 2 is skipped (i placed a trace action on this frame to determine this), in which case it can't find the target. Also, I can see that small.swf is loaded, it just isn't at the correct frame (ie, it's at "start" instead of "play")

hope this long-winded explanation is clear, and someone has the patience to read it and respond!

thanks,

anna

Jesse
08-08-2001, 05:08 AM
is this a typo or does your code really say:
if (_level0:S eq "small){ without the closing quote?

atbonner
08-08-2001, 03:46 PM
no, that was just a typo-- the quotes are closed correctly. I wish it were something so simple!

atbonner
08-08-2001, 05:07 PM
i've fixed the problem by changing the button actions (displaySize is the label on frame 2)

previously:
TellTarget ("refresh"){
gotoAndPlay ("refreshAll")
}

now:

TellTarget ("refresh"){
gotoAndStop ("refreshAll")
}
TellTarget ("refresh"){
gotoAndPlay ("displaySize")
}

now it works correctly all the time.
it doesn't make sense to me that these two approaches would behave any differently. there's no stop sign on frame 1 (refreshAll). Am I missing something fundamental about the order in which flash executes commands? any advice or references to good sources on this topic would be appreciated. i am having some other porblems which i think may have a similar cause.