I have a mc that I use as a stop/play button for music. One the main stage there are 3 of these buttons for 3 different songs. One frame one of each MC there is a triangle for play with this code:
stop();
btn_play.onRelease = function (){
stopAllSounds();
gotoAndPlay(2);
}
Then on frame 2 there is a square for stop with this code:
stop();
btn_stop.onRelease = function (){
gotoAndStop(1);
stopAllSounds();
}
It works fine as far as stopping and playing. The stopAllSounds is to prevent the music from overlapping in case the user didn’t press stop before playing a different song.
Here’s the problem:
If the user presses play to hear a song then wants to hear another song so he decides to click play on a different song without first clicking the stop button there a problem.
The problem is that he is still stopped on frame 2 of the first song therefor the square is still visible. In this case in order to hear the first song again he would have to double click.
My question is:
Is there any way, from the main timeline, I can tell it onRelease of a specific button within a specific buttion to make a different mc to got frame 1?