开发者

Stop all sounds but one

开发者 https://www.devze.com 2022-12-25 18:49 出处:网络
I posted a question earlier about stopping all sounds in a swf. Now, to do that I\'m using the following code.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消