views:

1539

answers:

4

MovieClip(_loader.content).stop(); this.removeChild(_loader); _loader.unload(); _loader = null;

I've been trying that, but it doesn't stop the movie. The movie has an embedded voiceover and that keeps running. thank you.

A: 

If the only remaining thing that is playing is the sound, use SoundMixer.stopAll() to stop that as well.

Raul Agrait
I tried doing that. But as soon as another movie with a voice over begins, the old voiceover joins in as well. :(
A: 

Make sure the embedded voice over is set to stream. If its on event, it will just keep playing until it's done regardless of the playhead of the swf.

Alex Jillard
+1  A: 

Flash 10 introduced unloadAndStop(); (_loader.unloadAndStop() if it's named _loader like in your example) and if you are using Flash 10 then you should use this.

But the original idea of what Adobe intended in AS3 for Flash 9 was that the loaded in swf would be self reliant, able to detect when it was removed and stop the sound from within itself. Use this inside the swf that is being loaded in, so that it can detect when it is removed from the stage, and therefore shut down it's own sound:

addEventListener(Event.REMOVED_FROM_STAGE, swfWasRemoved);

function swfWasRemoved(event: Event) : void
{
  // inside this function shut down the sound that is inside the swf
}
Bryan Grezeszak
A: 

Thank you! Thank you!!!!! I've been struggling with this for a month! I tried everything but didn't work... SoundMixer.stopAll(); loader.unload(); loader.unloadAndStop(true); removeChild(loader);

Now it does!!! :-) I forgot to set the sound in one of the swf files to stream!!!

sandra