Software: Macromedia Flash 8
Time: 6 minutes
Turn sound on or off
1. Open new document. I will set 100*100, you can chose what you want.
2. Type some text or make some button for stopping music. I'll put just sound on/off.

3. Select text wich you insert and convert to Movie Clip (F8)

4. Change instance name for converted text in to: control

5. Double-click on converted item.
6. In 1st layer is your text (or button). Go and make new layer.

7. In second layer you need to set up volume control. We'll do it with actionscript. You need to put keyframe in every frame of your 2nd layer. It must look like this (you need to have 13 ketframes at all):

8. Now we need to open actionscript window for every single frame and set up volume. You can open actionscript window by selecting frame and pressing F9. Let's go to fill actionscript (I suggest to use copy/paste):

frame 01 |
|
s = new Sound( );
s.attachSound("mysound");
s.setVolume(100);
s.start( 0 , 50000 );
|
Finish? Select next frame |
frame 02 |
|
stop();
|
Finish? Select next frame |
frame 03 |
|
s.setVolume(75);
|
Finish? Select next frame |
frame 04 |
|
s.setVolume(50);
|
Finish? Select next frame |
frame 05 |
|
s.setVolume(25);
|
Finish? Select next frame |
frame 06 |
|
s.setVolume(0);
|
Finish? Select next frame |
frame 07 |
|
stop();
|
Finish? Select next frame |
frame 08 |
|
leave empty
|
Finish? Select next frame |
frame 09 |
|
s.setVolume(25);
|
Finish? Select next frame |
frame 10 |
|
s.setVolume(50);
|
Finish? Select next frame |
frame 11 |
|
s.setVolume(75);
|
Finish? Select next frame |
frame 12 |
|
s.setVolume(100);
|
Finish? Select next frame |
frame 13 |
|
gotoAndStop(2);
|
Finish? You must have same situation like below |

9. OK, after this hard work we just need to set up button and everything is over. Select text (or button) from Layer 1 and convert it to button (F8).

10. Click one on new button, and open actionscript window (F9). Write this code:

code |
|
on (release) {
if (getProperty ("/control", _currentframe )==2) {
tellTarget ("/control") {
gotoAndPlay(3);
}
} else if (getProperty ("/control", _currentframe )==7) {
tellTarget ("/control") {
gotoAndPlay(7);
}
}
}
|
|
11. We are almost done. Double-click on button. Select frame below HIT and press F6.

12. Draw square around the text and after that back to root.

13. Last thing. On root you need to add some music. First, import music to stage (Ctrl+R), than select Layer 1 and just add music.

14. OK, we are done and we have our perfect volume control. Try this one:
|