Stop all sounds but one
I posted a question earlier about stopping all sounds in a swf. Now, to do that I'm using the following code.
var transform1:SoundTransform=new SoundTransform();
transform1.volume=0;
flash.media.SoundMixer.soundTransform=transform1;
Which solves the problem (mutes all sounds) but now there is an issue, I want to stop all sounds but one开发者_如何学C. Any Ideas?
You have to keep track of all SoundChannel
s that are currently playing back. you should create a sound manager instead of calling Sound::play
directly, and do all the tracking within the manager. then you'll just a a method to do what you need to.
You have to individually stop each SoundChannel
.
精彩评论