Flash Course

Sounds are added in Frames in the Timeline, after the file with the sound was imported in the Library panel.
You can use sounds from the Sounds Library integrated in the Adobe Flash program or they can be imported from your computer (with File -> Import -> Import to Library).
Flash recognize the following types of audio files: MP3, WAV, AU, ASND (obtained with Adobe's Soundbooth).
- In this tutorial we use sounds from Flash Sounds Library.

Buttons have a specific Timeline, with 4 special frames: Up, Over, Down and Hit. To add sounds to buttons usually we use the "Over" and/or "Down" frames.
- "Over" performs the efect when the mouse is over the button.
- "Down" trigger the effect when the button is clicked.


In the following example we create a simple button, and add in it a sound effect for the moment when the mouse is positioned over the button, and another sound when the user clicks on the button.
Follow these steps:
  1. Open a new Flash document. Then add in the Library panel 2 sounds from the Flash Sounds Library.
    To add the sounds, click on the menu Window -> Common Libraries -> Sounds, open the Library panel (Ctrl+L), and then from the Sounds Library drag with the mouse two sounds in the Libray panel (for example "Animal Dog Bark 26.mp3" and "Animal Mammal Carnivore Domestic Cat Meow 02.mp3").
    Library Sounds
      - You can test the sounds by clicking on them, and then on the "Play" button (top-right corner).
  2. Close the Sounds Library, and choose the tool for drawing oval shapes (Oval Tool) and draw a circle on the Stage.
  3. Now the circle must be convertet into a button.
    Make sure the circle is selected (if not, select it with "Selection Tool"), click on the menu Modify -> Convert to Symbol, select the Button type option (you can also give it a name, in the Name box) and click OK.
  4. The button is added in the Library. Double click on it to enter its editing page. In this page, right-click on the "Over" frame in the Timeline and choose Insert Keyframe. Also change the color of the circle (from "Fill Color"), to see the diference when the mouse will be over it.
  5. Now we add a sound in the "Over" frame, that will be heard when the mouse is over the button.
    With this frame selected, open the Properties panel, then go to Sound, click on the list of options from Name, and choose one of the added sounds. Then, set Start to Sync (it is explained at the end of this tutorial what the options from "Sync" make).
  6. Now we add a sound in the "Down" frame, that will be heard when the button is clicked.
    Right-click on the "Down" frame in the Timeline and choose Insert Keyframe. In Properties panel, go to Sound, and chose the other sound in the options list from Name, then select Start from Sync.
  7. The button was made, the sounds added; so press "Ctrl+Enter" to test the result.
      - Flash will display a presentation like this (click on the green button):

- Tutorial adding sound in Button

- In the following presentation you can see how to do this example (click on the picture below).

tutorial_sounds_buton_steps
- To download the FLA file with this example, click: Adding sound in Button.

Options for sound

The Sound sub-menu in the Properties panel 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.

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
Adding sounds to buttons

Last accessed pages

  1. Vue JS - Transition and Animation (490)
  2. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (141749)
  3. Node.js Move and Copy file (28420)
  4. MouseEvent - Events for Mouse (2909)
  5. PHPMailer (2311)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (473)
  2. CSS cursor property - Custom Cursors (79)
  3. The Mastery of Love (70)
  4. PHP-MySQL free course, online tutorials PHP MySQL code (62)
  5. CSS3 2D transforms (46)