Flash tutorials
Home 3D (2) Actionscripting (66) Animation (108) Audio (4) Drawing (7) Full flash sites (4) Getting Started (15) Navigation (25) Special Effects (61) Text Effects (38)

Sound Button

26.1.2007, 23:9    Total views: 69455

I am going to show you how you can make a sound button in flash 8 using the Action Script.



Step 1

First of all, create a new Flash document (Ctrl + N).

Step 2

Using the flash tools for drawing, draw any "sound symbol". For this example, I'll draw this:



Step 3

While the "sound symbol" is still selected, press F8 key ( or select Modify > Convert to Symbol ) to convert this "sound symbol" into a Movie Clip Symbol. See the picture below.



Step 4

Double-click on the movie clip on stage with the Selection tool (V). You should now be inside the movie clip.



Step 5

After that, while the "sound symbol" is still selected, press again F8 key to convert it into a Button. See the picture below.



Step 6

While the Button is still selected, open the Action Script Panel (F9), and enter the following Action Script code inside the Actions panel:

on(release){gotoAndStop("activation")}

Step 7

Click on frame 2 and press F6 key. Then, enter the following Action Script code inside the Actions Panel:

stop();
stopAllSounds();

Step 8

After that, while you're stll on frame 2, go to the Properties Panel (F9) below the stage, and for type silence. See the picture below.



Step 9

Then, take the Selection Tool (V),click once on the "sound symbol" to select it, and in Actions Panel enter the following Action Script code:

on(release){gotoAndStop("activation")}

Step 10

Click on frame 12 and 24 and press F7 key. Then, while you're still on frame 24, in Actions Panel enter the following A.S.code:

gotoAndStop("silence");



Step 11

Create a new layer above layer 1 (layer 2). Go back on the first frame of layer 1, press Ctrl+C key (Copy), click on frame 12 of layer 2 and press F6 key, and after that Ctrl+Shift+V key (Paste in Place).

Step 12

While the "sound symbol" that you're just copied is still selected, and while your still on frame 12 of layer 2,open the Actions Panel (F9). delete the previous script, and paste this scritp:

on(release){gotoAndStop("silence")}

Step 13

Lock layer 1, click again on frame 12, and draw the "sound waves" using the flash tools for drawing, like it is shown on the picture below.



Step 14

Take the Selection Tool (V), click again on frame 12, and inside the Actions Panel paste this script:

stop();

Step 15

While you're still on frame 12, go to the Properties Panel below the stage, and for type activation



Step 16

Go back on the first frame of layer 2, and enter the following Action Script code, inside the Actions panel :

gotoAndStop("activation");

Step 17



Step 18

Choose File > Import > Import to Library, and Import any mp3. file into the Library.



Step 19

Click on frame 12 of layer 2, and using the "drag and drop technique" move the sound file from the Library on the stage.



Step 20

Go back on the main scene (Scene 1), and test your Movie (Ctrl + Enter).

We're done!

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!

Top tutorials

1. Advanced full flash site - Part 1
Total views: 296724

2. High-tech city animation
Total views: 247536

3. Water effect
Total views: 227021

4. Photo slide show
Total views: 209314

5. Special Picture Effect
Total views: 184886



Related links