music loop fade out by button between scenes
Hi
I have a infinite music loop and I am trying to have btn_start trigger a fade out on the music along with its original gotoAndPlay.
I have two scenes, "opening" and "animation". btn_start and the following code are in the "opening" scene.
the fade out will play along with the first couple seconds of "animation" since the gotoAndPlay connects to frame 1 of "animation"
Can this be done? Please show me some lights of how to proceed this.
stop();
import flash.net.URLRequest;
import flash.media.Sound;
var url:URLRequest = new URLRequest("subtle.mp3");
var snd:Sound = new Sound(url);
snd.play(0, 17);
btn_start.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
gotoAndPlay(1, "animation");
}
thanks!!
