To add sound to your flash
movie is very easy. Just import a sound file (in whatever
format the flash editor can handle, e.g. mp3, wav...
etc), and pull it onto the stage! However, if you want
to have better control in playing the sound file, you
may need some actionscripts.
Below is an example where you can start
and stop the music by pressing the corresponding start
& stop button.
Open a new file in the Flash editor. Import
a sound file into the library. Right click on the imported
sound (in the library window; you may need to open the
library window first), select link on the pop up menu.
Check the export to actionscript option and type the
name "mysound" in the textbox. This will assign
an id to the imported sound, so later on the actionscripts
can refer to it.
Ok, back to the main stage. Select the
first frame on the timeline, open the action window
and put the following code in it:
var snd = new Sound();
Basically, the above code will create
a sound object and attach the imported sound file to
Insert a new clip/button symbol and name
it as "playbtn". Draw whatever you want the
button look likes. Then move back to the main stage,
drag the button symbol from the library window (place
it any where you like). Select the "playbtn"
on the stage and put the following code in the action
This will start playing the sound (and
loops 10 times) when the button is clicked.
Repeat step 3 to create the stop button
(name it as "stopbtn"), but associated with
the following actionscritps instead:
Thats all. Test your movie and Enjoy!
Index - Download
this tutorial - Post