Flash lets you add sounds into your presentation. The sounds are added in Frames in the Timeline.
There are two types of sounds: event sounds and stream sounds.
- An event sound needs to download completely before it starts to play. Event sounds continue to play until they are done or you explicitly stop them.
- A stream sound starts to play as soon as enough data downloads for the first few frames. Stream sounds are synchronized to the Timeline.
Flash supports the following sound formats: ASND (from Adobe Soundbooth), WAV, AIFF, AU, MOV, and MP3.

First, you need to import the sound into the Library. Then, you add it in Frames in your Timeline.
To import a sound file, click File -> Import -> Import to Library, then choose an audio file from your computer and click Open. Flash places a copy of the imported sound file into the Library.
- You can also use the sample Sounds library that comes with Flash, which can be opened from Window -> Common Libraries -> Sounds.
The sounds added in the Library will be included into the Flash presentation (the SWF file), so the size of the SWF file will increase depending on the size of the imported audio file.

Once the sounds are in the Library, you can add them in the Timeline using the Properties panel of the Frames (see the image below).
In Timeline, click on a frame where you wand to begin the sound, then in the "Properties panel", at the Name option (from the Sound sub-menu) choose the sound you want to use.
Properties for sound
The Sound sub-menu contains a few options to define individual properties for every sound in your Flash document:
- Name - contains a list with the sounds included in the Library.
- Synk: - Effect: - Repeat - specifies how many times the sound will be repeated. Loop sets to repeat the sound forever.

Here is an example of how to use a sound from the Sounds library that comes with Flash:
  1. Open a new Flash document. Click the Window -> Common Libraries -> Sounds to open the "Library - Sounds" window (displayed in the image below).
    Open the main Library panel (Ctrl+L), then chose a sound in the "Library - Sounds" and drag it in the main Library panel.
    - Or you can import audio files from you computer, with File -> Import -> Import to Library.
    Library Sounds
    - You can test the sounds in the "Library - Sounds" by clicking on them, then click the "Play" button.
  2. Now we add the sound in Timeline. Click the first keyframe, then in the Properties panel, in the Sound sub-menu, click the Name option list, and then choose the included sound.
    - Press "Ctrl+Enter" to test the presentation.
  3. Change the Sync, Effect and Repeat properties and press "Ctrl+Enter" to understand their effects.

To stop a sound:
  1. In timeline, click on the frame in which you want to stop the sound.
    - If it is a Static frame, you must convert it in a keyframe (or Blank Keyframe), from Modify -> Timeline -> Convert to Keyframes (or "Convert to Blank Keyframes").
  2. In the Properties panel, in the Sound sub-menu, click the Sync option list, and choose Stop.

Effect Settings

The Properties panel provides some effects you can apply to the volume of a selected sound. The drop-down list next to Effect includes effects such as "Fade In", "Fade Out", "Fade Left to Right", and "Fade Right to Left". To customize these settings further, you can either select Custom from the list or click the Edit button (next to drop-down list) to access the ""Edit Envelope" dialog box, which is shown in the image below.
Edit Envelope window

Adding sound to Motion Tween

The frames in a Motion Tween don't have in their Properties panel an option to add sounds.
If you want to include a sound in a Motion Tween animation, you must create a new Layer and add the sound in the frames of that Layer.
These are the steps to add sound to a motion tween animation:
  1. Click Insert -> Timeline -> Layer to create a new Layer
  2. In this new layer, click on the frame from which you want to begin the sound, then click Insert -> Timeline -> Blank Keyframe (or right-click and choose Insert Blank Keyframe).
  3. Now, you can use the Properties panel of this keyframe to add the sound in it.
- The sound will begin to play starting from that Blank Keyframe, along with animation. The Timeline will appear similar to the picture below.
Sound with Motion Tween
- The "Layer 1" contains the Motion tween frames, the "Layer 2" contains the sound, starting from Frame 11.

Compressing Sound

Flash has a few compression settings that would reduce the size of the SWF exported file (which contain sounds).
In the Library panel, double-click on the name of the sound (or right-click on it and choose "Properties"), Flash will open the "Sound Properties" window, with settings for the selected audio file, like in the image below. Compressing Sound
Changing the compression will also change the sound quality, Flash can't get a better quality than the original audio file, but can decrease its quality when the values from "Bit Rate" and "Quality" ​​are reduced.
- MP3 is the best type compression for a good quality / size ratio.
- The "Update" button is used to reload the sound file from its initial location.
- If a sound has 4 seconds and the FPS is 24, the sound needs 4x24 frames (96) in timeline.

Daily Test with Code Example

Which tag defines the clickable areas inside the image map?
<map> <img> <area>
<img src="image.jpg" usemap="#map1">
<map name="map1">
  <area shape="rect" coords="9, 120, 56, 149" href="#">
  <area shape="rect" coords="100, 200, 156, 249" href="#">
Which CSS property defines what is done if the content in a box is too big for its defined space?
display overflow position
#id {
  overflow: auto;
Click on the event which is triggered when the mouse is positioned over an object.
onclick onmouseover onmouseout
document.getElementById("id").onmouseover = function(){
  document.write("Have Good Life");
Indicate the PHP variable that contains data added in URL address after the "?" character.
if(isset($_GET["id"])) {
  echo $_GET["id"];
Add sounds and audio effects in Flash

Last accessed pages

  1. Multiple Select Dropdown List with AJAX (15558)
  2. Moving html element to a random direction (84)
  3. XHTML References - Old (15)
  4. Star shapes with CSS (4464)
  5. Get and Modify content of an Iframe (12618)

Popular pages this month

  1. Read Excel file data in PHP - PhpExcelReader (387)
  2. Register and show online users and visitors (355)
  3. PhpSpreadsheet - Read, Write Excel and LibreOffice Calc files (327)
  4. Insert, Select and Update NULL value in MySQL (256)
  5. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (254)