AS3: Stop all sounds from playing

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();

27 Replies to “AS3: Stop all sounds from playing”

  1. 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!!

  2. 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.

  3. 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!!!!!!!!!!

  4. 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 🙁

  5. 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.

  6. To mute all sounds use :
    SoundMixer.soundTransform = new SoundTransform(0);

    To unmute all :
    SoundMixer.soundTransform = new SoundTransform(1);

  7. How can it be that simple! Ha Ha. Yeah I am in with everyone else. I wanted to stop all the sounds so I created a for loop with the channel to stop everything added to the channel and that didn’t do any good. Blah! thanks for the 2 lines of code 🙂

  8. Any solution to stop sounds if the user leaves the frame while the sound/video is still buffering? This doesn’t work in that case. Thanks!

  9. when i use this SoundMixer.stopAll(); in my movieclip code to stop mixing each frame containing sound it works but it also stops my bg sound that i have code in my document class.

    so please can u help to avoid this problem.

  10. Is their a code to start all sound for a video that is just looping. If I add the code to stop, when the cartoon loops the audio does not restart.

Leave a Reply