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.
STEPS TO FOLLOW
To start with, make 2 buttons. 1 for ON and another, for OFFDemonstration | ||
|
Next you need to create 2 Movie clips.
- For sound
- For buttons
- Create three keyframes.
- Insert stop action to all the keyframes.
- Insert your music into frame1.
- In frame2 insert the following code,
gotoAndStop(1);
- In frame3 insert the following code,
gotoAndPlay(1);
Next, Lets start with the Button Movie clip
- Create 2 keyframes.
- Insert stop actions to both the keyframes.
- Insert OFF button into frame1.
- Select your OFF button and insert the following code,
on (release) {
tellTarget ("../music") {
stopAllSounds();
}
}
on (release) {
nextFrame();
} - Insert ON button into frame2.
- Select your ON button and insert the following code,
on (release) {
tellTarget ("../music") {
nextFrame();
}
}
on (release) {
prevFrame();
}
- Insert your Sound Movie clip into your movie and name it "music" in your instance panel.
- Insert your Button Movie clip into your movie.
- Now press ctrl+enter to play your movie.
sumber :http://www.entheosweb.com/Flash/flash_sound_button.asp
0 komentar:
Posting Komentar