In this tutorial you will learn how to create a simple Flash music on and off button using Flash actionscript. Fla download is also included.
This tutorial starts with the music on. On clicking the button music goes off (as seen in the demo). You can start the music again at any point during the movie.
Demonstration (swf file) |
Download the .fla |
To start with, make 2 buttons. 1 for ON and another, for OFF
Next you need to create 2 Movie clips.
Okay let’s start with the Sound Movie clip
gotoAndStop(1);
gotoAndPlay(1);
Now you are through with your Sound Movie clip.
Next, Lets start with the Button Movie clip
on (release) {
tellTarget ("../music") {
stopAllSounds();
}
}
on (release) {
nextFrame();
}
on (release) {
tellTarget ("../music") {
nextFrame();
}
}
on (release) {
prevFrame();
}