I posted a question a day or two ago about my STOP buttons not appearing after the user selects a song by pressing the PLAY button. I have 3 song choices and the play buttons are vertically aligned. STOP buttons are directly behind the PLAY buttons, so after a song is selected, the stop button appears.
Ok, I got them to appear now but they do not stop the song. In addition, I’m using a layer named “Album Covers” that display the song’s album cover and I’m trying to use that in the code with as play and stop actions.
What am I missing? I’m going to try to attach my FLA, but if it doesn’t load, here is the gist of my code.
Code for PLAY button - each play_btn has their own (identical) code but will post the first play button code)
on(release){
_root.my_sound.start(0,1000);
_root.gotoAndStop("Eagles")
}
STOP button code (same concept that each stop button has identical code except for Album Cover reference)
on(release){
_root.my_sound.stop();
_root.gotoAndStop("stop")
}
Code in first frame of Actions layer:
stop();
play_btn1.onRelease = function ()
{
stopAllSounds ();
song1 = new Sound ();
gotoAndPlay ("Eagles");
song1.loadSound ("Desperado.mp3",true);
};
play_btn2.onRelease = function ()
{
stopAllSounds ();
song2 = new Sound ();
gotoAndPlay ("Elton John");
song2.loadSound ("Rocket Man.mp3",true);
};
play_btn3.onRelease = function ()
{
stopAllSounds ();
song3 = new Sound ();
gotoAndPlay ("CSN");
song3.loadSound ("Southern Cross.mp3",true);
};
Code in 2nd frame of Actions layer:
stop_btn1.onRelease = function () {
stopAllSounds();
}
stop_btn2.onRelease = function () {
stopAllSounds();
}
stop_btn3.onRelease = function () {
stopAllSounds();
}