If you ever need to stop all the sounds playing in flash using ActionScript3, you can do so using the following method.
First include the SoundMixer class:
import flash.media.SoundMixer;
Then to stop the sounds call the stopAll method:
SoundMixer.stopAll();
I am SO THANKFUL for this simple explanation. I’ve spent days trying to figure this out and this was exactly what I needed. The new and improved “stopallSounds” for the AS3 newbs!!
Me too! As the manual didn’t take me anywhere with manuals
obviously at fault then seeing most people looking for a solution
to start and stop sounds failing I was relieved. I would still like
to see a working solution with the SoundChannel object where the
stream may be stopped and resumed.
There is a god… This had me stumped for hours, sounds playing over each other blah blah. These two lines saved my life
Thank you…. this thing works so well……
I flippin love you. Thank God I found this. I’ve been working on this since 2pm and it’s currently 1:26am, that whole time I’ve been trying to figure out how to stop overlapping sound. Thank you, thank you, thank you!!!!!!!!!!
doesn’t stop the FlvPlaybackComponent sound !!!!
does not stop all sounds from embedded sources inside of AIR……lol.. just saying…
Thanks for this but for I am creating a sound on/off button how will i play same sound..
This right here is what I look for when I’m trying to figure stuff out on flash, simple solution that works! Thanks!
Doesn’t work, i have my sounds imported through AS3 i have images, 1 frame long and you can navigate by buttons to the next frames.. i have 5 of those frames, and every frame has his speech. But after i had the 3th frame, and enter the 4th frame the sound of the 3th frame alsof plays, and i can’t stop this.. i don’t know how to stop that sound of the 3th frame
Very easy and elegant solution. Thank you.
I have place the soundMixer.stopAll() to stop the all sound but its not working.
I have loaded the sound dynamically. beside stopAll method is there a any other solution to stop all the sound which are playing in swf.