Flash Course

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

HTML
CSS
JavaScript
PHP-MySQL
Which tag is used to add lists into <ul> and <ol> elements?
<dt> <dd> <li>
<ul>
 <li>http://coursesweb.net/html/</li>
 <li>http://coursesweb.net/css/</li>
</ul>
Which value of the "display" property creates a block box for the content and ads a bullet marker?
block list-item inline-block
.some_class {
  display: list-item;
}
Which instruction converts a JavaScript object into a JSON string.
JSON.parse() JSON.stringify eval()
var obj = {
 "courses": ["php", "javascript", "ajax"]
};
var jsonstr = JSON.stringify(obj);
alert(jsonstr);    // {"courses":["php","javascript","ajax"]}
Indicate the PHP class used to work with HTML and XML content in PHP.
stdClass PDO DOMDocument
$strhtml = '<body><div id="dv1">CoursesWeb.net</div></body>';
$dochtml = new DOMDocument();
$dochtml->loadHTML($strhtml);
$elm = $dochtml->getElementById("dv1");
echo $elm->nodeValue;    // CoursesWeb.net
Add sounds and audio effects in Flash

Last accessed pages

  1. PHP Simple HTML DOM Parser (12469)
  2. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (142527)
  3. Paragraphs, Line break, Horizontal rule (4310)
  4. Convert BBCode to HTML and HTML to BBCode with JavaScript (9417)
  5. Output or Force Download MP3 with PHP (5818)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (530)
  2. The Mastery of Love (65)
  3. CSS cursor property - Custom Cursors (63)
  4. Read Excel file data in PHP - PhpExcelReader (59)
  5. PHP-MySQL free course, online tutorials PHP MySQL code (44)