Flashvault.net

Turn on/off sound in flash

13.8.2006, 2:16    Total views: 54004
If we compare this tutorial with the previous two tutorials the difference is enormous. This tutorial gives us the chance to turn on and turn off the sound using play and stop buttons.



Step 1

Create a new Flash Document, click on file > Import > Import to Library and choose C:disk > Windows > Media > Windows XP Startup, to import a sound into a flash Library.



Step 2

Draw a "play" and "stop" buttons on the stage.

Step 3

After that select it (Ctrl+A) and press F8 on the keyborad (Convert to Symbol) to convert it into a Movie Clip. Look at the picture below!





Step 4

Double click on a new made Movie Clip (stop and play buttons) or right click and choose Edit in Place.



Step 5

Select the "play" button, and press F8 on the keyboard to convert it into a button. Look at the picture below!





Step 6

Select the "stop" button, and convert it into a button in an equivalent way like we have converted the play button.

Step 7

Insert a new layer and name it sound. Then click on the first frame of layer sound and using drag and drop technique move your sound (Windows XP Startup) from the Library on the stage.

Step 8

Click again on the first frame of layer sound, open the Properties Panel (Ctrl+F3), and under Repeat option set some huge number.

#ads#



Step 9

Insert a new layer and name it action.



Step 10

Take the Selection Tool (V), and do like it is shown on the picture below! (Select the second frame of all layers and press F6)



Step 11

Click on the first frame of layer action, open the Action Script Panel (F9), and paste this script:

stop ();

Step 12

Select the second frame of layer action, and paste this script:

stopAllSounds();

Step 13

Click on the first frame of Layer1, select the "play" button, and press Ctrl+B on the keyboard (Break Apart).



Step 14

While you're still on the first frame of Layer1, select the "stop" button, open the Action Script Panel (F9) and paste this script:

on (release) {
nextFrame();
}

Step 15

Click on the second frame of Layer1, select the "stop" button and press Ctrl+B on the keyborad to break it, like we have done for "play" button in step 13.

Step 16

While you're still on the second frame of Layer1 select the "play" button, open the Action Script Panel (F9) and paste this script:

on (release) {
prevFrame();
}

Test your movie (Ctrl+Enter).

We're done!

Bye!

Download source file (.fla)
Have questions about this tutorial?
Visit our friendly Community Forums!
Digg it! Add this tutorial to del.icio.us! Furl it! Add this tutorial to reddit! Spurl it! Add this tutorial to technorati!

Forum - Newest Discussions

Convert FLV to iPod MP4 Video
Last post by: linddy
Date: 04.12.2008 10:40:59

How do I combine images with text simultanuelsy?
Last post by: speedyj
Date: 03.12.2008 23:10:49

Convert AVI Video to Flash
Last post by: linddy
Date: 29.11.2008 04:40:55

photogallery
Last post by: trnghosn
Date: 26.11.2008 16:22:19

For Sale Brand NewHTC Touch HD $380Samsung i900 Om
Last post by: so100
Date: 25.11.2008 13:01:33

For Sale Brand NewHTC Touch HD $380Samsung i900 Om
Last post by: so100
Date: 25.11.2008 13:00:48

Waiting for your hour of triumph? It is near!
Last post by: VitaMary
Date: 21.11.2008 18:46:41

Yeow dogs!
Last post by: deco11
Date: 21.11.2008 01:15:49

Show your girlfriend what a real sex is!
Last post by: VitaMary
Date: 20.11.2008 22:00:13

Related links