Looping sound and changing volume
What Im looking to do is decrement the volume level on each iteration of a looped sound. How can I achieve this?
here's my code thus far
var playCh:Dictionary = new Dictionary();
//.... private static function loopMySnd(id:String, loopAmount:int):void{
playCh[id] = new Sound();
playCh[id].addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);
playCh[id].play(0, loopAmount);
}
private static function onPlaybackComplete(event:Event):void {
trace("The sound has finished playing.");
}
How do I check each time it loops? I'm currently storing all playing sounds by ID inside a Dictionary object. Keep in mind that there will be different sound playing. I wasn't sure if I should be using a SoundChannel here either.