Jun 30 2009
Controlling Timeline Sounds in AS 3.0
I came across this very useful feature of AS 3.0, previously to control timeline sounds you had to do a lot of crazy things. Yes it was possible using AS 2.0 as well but not as straightforward.
If you have a document class for your main movie, this piece of code is all you need.
var effectSounds:SoundTransform = new SoundTransform();
effectSounds.volume = 0.3;
this.soundTransform = effectSounds;
effectSounds.volume = 0.3;
this.soundTransform = effectSounds;
Yep only 3 lines of code and it controls sound for every swf loaded and if you want to increase the sound in certain Movieclip you can just add another sound transform to it and control the audio.