Sounds can be loaded into a Flash document in the same way as video and images and can be used in a variety of ways, for example to give an extra dimension to buttons or events.
To begin with you need to identify or process the sounds you want to use. If you are going to attach sounds to events such as mouseover, mousedown, mouseup, etc. the sounds need to be fairly short, not whole songs or symphonies. Whole song files tend to be quite large and you must be careful not to breach copyright be using music without permission. Use a program like Audacity to create or edit sounds.
To add a sound it is a good idea to create a movie clip that contains the sound. Create a symbol (Ctrl/F8) of type movie clip and call it something like 'drums_mc'.
Add a layer for the sound and any other layers you want for graphics. Name the top layer 'actions'. Select frame 2 of the audio layer and press F6 to add a keyframe. Press Ctrl/R to import an asset and choose the sound file you require. Select frame 1 of the actions layer and enter 'stop();'.
Click on Scene 1. Add a layer to hold the movie clip containing the sound. Drag the movie clip (drums_mc) onto the stage.
Add a layer to hold a button (we will play the sound in response to release of a button). Add a rectangle, select it, press F8 to create a button symbol and add an instance name such as 'btn1'.
Add a layer to hold the ActionScript for the movie. Click in frame 1 of the actions layer and add this code:
btn1.onRelease = function() {
drums_mc.play();
}
Test the movie. The sound should play in response to the button press.
You can also make the sound play in response to an event such as the three available for a button (Over, Down, Up).
Double-click the button to edit it. Click in the Over state frame in the timeline. Drag the sound file (mp3 or wav) onto the stage - the frame will show a horizontal line dividing it in two.
Click on Scene 1 and test the movie - the sound should play now when the mouse goes over the button. You could add sounds for the Down and Up states and create some interesting, amusing or even useful effects (to improve accessibility for certain users, for example). Remember, however, that sound files can be large and you don't really want your users waiting a long time for sound effects that serve no real purpose. Sounds played in response to mouse clicks or key presses may be essential to games.