Global sound volume in Flash AS3
Do you guys have tasks that are so simple and also so uncommon that you can never remember how to do them? This is one of those for me. I don't usually work on projects that involve sound, but when I do I inevitably want to put a mute button. I *always* manage to forget how to do that though, and have to do a quick search for the answer.
So, with the hopes that next time I forget this it will be written down somewhere I can remember, here is how you adjust the global sound in AS3.
SoundMixer.soundTransform = new SoundTransform(0);
That example mutes all sound within the app. (Well, within the ApplicationDomain, or so I'm told.) All you have to do is access the static SoundMixer class and you're good to go. You also need to create a new SoundTransform object -- simply editing the current one doesn't do much good.
Related Posts
Profiling live Flash applications
How to use the Flex/Flash Profiler on live Flash, even if it's totally a non-Flex project. (Like FlashDevelop projects!)
AS3 Flash sounds cutting off
A ridiculous fix for fixing issues with Flash MP3 sounds cutting when they're playing
Firefox Flash lock during load...
I'm experiencing a second or two where Firefox completely freezes during Flash load, any ideas?
FlashDevelop Singleton Template
A useful timesaver -- especially with the odd contortions one must perform to get a Singleton in Flash.
Greensock Tweening Platform v11
Jack just released the latest version of his Tweening Platform -- be sure to update!
Flash on the iPhone - the real story.
Some real facts and details regarding Flash apps running natively on the iPhone.
I'm Ryan Ragona, an Interactive Developer based in Seattle, and I write about AS3, Django, and more.
me on Twitter!

0 Comments