View Full Version : gotoAndPlay takes occassional breaks (?)

08-27-2007, 09:16 PM
Greetings Flashers,
I am new to Flash, Actionscripting and the Forums. I've spent a lot of time reading some hand-me-down Flash books, reading through the Actionscript dictionary and sifting through the Forums and I've been unable to find an answer to my problem.

PROBLEM: I've got a script in frame 6 of a movie clip that should start another movie clip playing half-way through.

_root.gopher_mid.gotoAndPlay (15);

About 85% of the time this works perfectly, but occassionally -sporadically -randomly -it does not work. The original clip always plays, but sometimes the dependent clip doesn't initialize. Sometimes it will work ten times in a row, but sometimes only once. I've traced everything and I can only conclude that sometimes it decides just not to play. I've removed variables so that I can reinitiate the sequence after it freezes, and it will work again and then freeze again, again seemingly at random. I've tried gotoAndStop because someone in an old thread said it was a load time problem, but it didn't change the functionality. I've tried labeling the frame and calling that, but still it only works sporadically. Does anyone have any ideas what is happening here?

SPECS: FlashMX 2004, Actionscript 2, 272 KB Flash Document -> 17 KB Flash Movie, relatively new computer with no performance issues to date.

08-30-2007, 02:49 PM
Sorry for the double post, but you folks seemed as stumped as I was. I do have new information, however.
It was the frequency of bug (15% of the time) that got me to thinking. I have an animation loop in gopher_mid (the movie clip) that is seven loops long, and is recycled by a this.gotoAndPlay () command in the last frame of the loop. I guess 15% of the time that actionscript and the actionscript in my other movie clip coincide (i.e. the frames with actionscript play at the same time), with the wrong one winning out. (I have tested the game without the animation loop and it works perfectly).
Is there a way to subordinate one movie clip's script to another's, so that the latter one wins out when there's a conflict? Or is there a more appropriate way to loop some middle frames in a movie clip?