This content has been marked as final. Show 6 replies
To stop the sound from playing use:
What I would do is put this code on the first frame of your scene:
myMusic = new Sound();
You could have the button be a movieclip that has two frames to it. The first could indicate to press the button to stop the sound, and put:
on the frame. Then put:
on the button (movieclip) itself so that it goes to the second frame when it's clicked, which has the stopAllSounds(); command on it. Then they could click it again and it would go back to the first frame again and just start playing the music again.
Someone else may have a better or more simple solution, but that should work.
Thanks! I'll try it out and see if it will work
I have a slight problem. Your method works, I tried it out. However, I am using scenes, so I copied and pasted my buttons to each scene. When I pressed stop music in one of my scenes, and when I navigate away from that scene, the movie clip is back to frame 1 again that has the stopAllSounds();. But I don't want that to happen, I want the movie clip to stay at the same frame when there is no sounds. Is there such actionscript as "if there is sound then go to frame 2, if there is sound then go to frame 1" So any way into this?
to create a movieclip button that toggles your sound off and on, use:
I think I got my movie clip sorted out but is there an actionscript that is something like if there is sound go to frame 1, if there is no sound go to frame 2?