Hey guys! Fate here, as always. Let's get down to business cause I'm kinda in a hurry xD
I created a start menu for my game, and it plays fine and dandy. Thing is, when the menu appears, BG music starts playing (that's fine, it was intentional), here's the code for the BG music play:
var BGmusic:Sound = new mainsoundtrack();
var MusicChannel:SoundChannel = new SoundChannel();
addEventListener(Event.ENTER_FRAME, asignarcanal01);
function asignarcanal01(event:Event):void{
MusicChannel = BGmusic.play(0,9999);
this.removeEventListener(Event.ENTER_FRAME, asignarcanal01);
}
After some basic animation passes and the buttons appear, the game stops until the player picks a button. When he does (in this case, the start game button), this code enters into action:
var startgame:Boolean = false
var snd:Sound = new gamestart();
startbutton.addEventListener(MouseEvent.CLICK, start01);
function start01 ( m:MouseEvent )
{
startgame = true;
snd.play();
play();
}
Everything is going as planned. Once the start button is clicked, it emmits a "start" sound and the menu begins to fade to black to let the game begin. However, obviously, the BG music keeps playing full force as the menu fades. How do I manage to fade out the music once a button is chosen? (I mean fading out until the last frame of the menu, not just simply stop on an abrupt halt)
Sorry for the rushed explanation, but as I said, I'm kinda in a hurry, but I wanted to leave this here so maybe someone can answer this and have a solution for when I get back xD
Thanks as always for the wisdom, oh wise ones -.-
Fate out!!!