停止所有声音,但一个(Stop all sounds but one)
我之前发布了一个关于停止swf中所有声音的问题。 现在,要做到这一点,我正在使用以下代码。
var transform1:SoundTransform=new SoundTransform(); transform1.volume=0; flash.media.SoundMixer.soundTransform=transform1;这解决了问题(静音所有声音),但现在有一个问题,我想停止所有声音,但一个。 有任何想法吗?
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. Any Ideas?
最满意答案
您必须跟踪当前正在播放的所有SoundChannel 。 你应该创建一个声音管理器,而不是直接调用Sound::play ,并在管理器中进行所有跟踪。 那么你只需要一种方法来做你需要的。
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.
更多推荐
发布评论