Adjust Global Sound Volume in Actionscript 3

There is a simple way to adjust all global sound in Actionscript 3. This encompasses all playing loops, sound effects and such.

All you need is the following code:

1
2
3
4
5
import flash.media.SoundMixer;
import flash.media.SoundTransform;

// volume limits are 0 to 1 (0.1,0.2,0.3,...,1)
SoundMixer.soundTransform = new SoundTransform(0);

Of course change the number sent to the SoundTransform constructor to anything between 0 and 1 (0.5 would be half max volume, 0 is muted.)

Share on FacebookShare on Google+Share on StumbleUponTweet about this on TwitterEmail this to someone

Facebook comments:

2 thoughts on “Adjust Global Sound Volume in Actionscript 3”

Leave a Reply