PDA

View Full Version : gotoAndStop(x) instantiates everything between current frame and x?


maskedMan
11-03-2008, 05:13 AM
So, I'm starting to become truly frustrated with a combination of two pernicious aspects of Flash CS3. One of which, the way it handles sound, there's not much to do about... but it gets worse when coupled with this:

So, let's say you have a main timeline that is 10 frames long, and each has a keyframe containing:

someClip_mc
- Which contains someClipChild_mc (a clip with a sound on the timeline starting on frame 2. Frame 1 has a stop action to prevent sound from playing).

Each instance of someClip_mc, s well as the someClipChild_mc inside it is from a different library item, so we have ten different sounds on the timeline.


Now, on your main timeline do this: gotoAndStop(10);


And now all of a sudden you hear a cacophany of sound! It is as though gotoAndPlay(10) caused flash to instantiate every clip that exists on frames 2 - 10, but then before the clips have a chance to execute their frame scripts they are 'removed' from the display list if they ever existed in the display list at all. Since the default action of a movieclip is to play, this is exactly what those nested clips do and because they aren't on the display list they don't execute the stop() action on frame 1! The same can happen if you "gotoAndStop(1)" from frame 10. Any time you use gotoAndStop() it seems to provoke this behavior if you use it to skip over frames in any direction.

So... why in the world does this happen? How can you stop it?

maskedMan
11-03-2008, 06:22 PM
Here, I've created a small sample of what I am talking about. The relevant as file is "Cacophony.as".

When you gotoandstop that last frame, all the previous frames instantiate and play, along with all their children and grandchildren even though there are stop actions on frame 1.

Why does this happen? How can you stop it?

creatify
11-03-2008, 06:52 PM
when I publish your sample, it goes to and stop on frame 10 and I don't hear anything. If I set to gotoAndStop on any of the frames with sound clips, I don't hear anything then either.

maskedMan
11-03-2008, 07:32 PM
Wow, you have officially blown my mind. I wonder what version of flash player you're using? What version is it compiling to?

Could you download this zip file and play the swf inside? Do you hear any sounds at all? Because I do.

Am I seriously the only one who experiences the cacophony?



EDIT: I have Flash player version 9.0.124.0. One of my officemates who is using 9.0.115.0 does not hear the sounds.

I am considering upgrading even further to flash player 10, but am quivering with fear. ;)

creatify
11-03-2008, 08:58 PM
mac safari 3.1.2 debug player 9,0,124,0 : I don't hear sound

mac FF 3.0.6 debug player player 9,0,124,0 : I don't hear sound

mac standalone player v 9,0,115 : I don't hear sound

mac standalone player v 9,0,115 : I don't hear sound

mac standalone debug player v 9,0,115 : I don't hear sound


hope this helps.

maskedMan
11-03-2008, 09:00 PM
That is pretty helpful, since there are no macs to test on here. Both I and my coworker tested on WIN versions.