I used ActionScript 3.0 and did about 30 seconds of the
Ghostbuster's movie soundtrack.
File menu, Import to Library,
and browse to the folder where you have your
1 minute long sound file.
It is best if its an .mp3 format sound file.
Click the Open button in the Import to Library dialog box after
you have selected the .mp3 sound file and you have it available
for your Flash movie.
1. Make an Action layer and have Keyframes at #1 and #20.
Here is the code for Frame #1 of Actions layer:
-------------------------------------------------------------------------
whoYaGonnaCall_btn.addEventListener(MouseEvent.CLICK, playGB);
function playGB(evt:MouseEvent):void {
gotoAndStop(20);
}
stop();
-------------------------------------------------------------------------
I named my button to start the song or sound, whoYaGonnaCall_btn
------------------
so the user will have to click the button to hear the song or sound.
Now go to Frame #20, which is a KeyFrame.
Click on Layer 1 (buttons layer is layer 2 and actions layer is
layer 3 for the top layer).
Layer 1, Keyframe #2 and frame 20 on the timeline is the active Frame.
Look at the Property Inspector for the Sound: combo box,
and select the sound that you imported to the Library.
It is automatically available there in the Sound: list. You will
see an indication in Frame #20 there that a sound is part of that frame.
There you go. Try out the application and see if it works.
Since the song is part of your library in Flash, the published
.swf file and .html file are all you need to upload, if you want to
put it on the web. It (the sound) is built into the published .swf file.
The .swf file that got published for the above example was
very much optimized as Flash compressed the original mp3 sound file.
ghostbusters.mp3 Audio File 812 KB
GhostbustersPlay.swf Flash Movie 66 KB
The .swf file contains the ghostbusters.mp3 sounds, but in a much
compressed format so they can quickly be served from the web
server to the client across the internet.
ghostbusters.mp3 - right mouse click then
download the file to folder where you saved your FLASH application.