Thursday, May 08, 2008

Flash SoundTransform




Something I just ran into with Flash: If you want to change the volume of a Sound object, though the SoundChannel you get when you press play and then through the SoundTransform object, you have to instantiate a SoundTransform object and apply it to your SoundChannel, like this:


mySoundTransform = new SoundTransform;
mySoundTransform.volume = 0.5;
mySoundChannel.soundTransform = mySoundTransform;