How to insert background music in Flash
This tutorial will show you how to insert an mp3 file into a Flash
document and then have it play automatically as background music. The
final product doesn't require any buttons or effort on the part of the
user as the music simply starts playing automatically once the .swf
file is loaded into the browser.
For this tutorial, I am using Flash CS3.
1. Import the sound file to the library of the project.
Select File->Import to Library
A dialogue box will appear. Find the sound file on your
computer and click "Open". The file will be imported to the project
library.
2. Create a new layer in the Flash document.
Find the layers panel at the top left of the timeline and right click
on the first layer. Click "Insert Layer" from the drop down menu.
You might want to label this layer as "background music layer".
3. Draw an invisible rectangle to hold the sound file.
Select the rectangle tool from the tool bar and draw a small
box outside of the document. The document is the
area that is visible to the web browser. It is designated
in all images in this tutorial by the large, dark blue rectangle area.
The gray area next to the dark blue rectangle is outside of the document
and is invisible to the web browser.
Note: if you want the sound file to play the full length of the
Flash movie, make sure the frames in the background music layer (the
layer you created in step 2) extends to the end of the movie.
4. Attach the sound file to the invisible box.
Select the first keyframe in the background music layer.

Find the "Properties" window at the bottom of the screen. If it isn't open, select
Window->Properties->Properties from the top menu.
Select "Sound" in the properties window. Click the name of the
sound file from the dropdown menu. The sound file is also in the "Library". It
is denoted by a speaker icon. The Library window is in the bottom right hand
corner of the above image.
Leave all the other options alone, except for the white box next to "Repeat"
with the "1" in it. Type "999" in this box. This will loop the
sound file and make it play throughout the movie.
7. Save and test your movie.
The sound file should start automatically
and loop over until the end of the movie.