|
||||||
|
||||||
Flash - Sound

Free
Flash Tutorial
In this tutorial you will learn how to add sound to your Flash Movie. This tutorial explains how to Import sound files into your Flash movie and then looks at the two different ways in which Flash handles sound: Event and Streamed sound. There is an explanation of both sound types and practical instructions of how to use each of these in your Flash Movies.
Importing Sound into your Flash Movie
Common Library
Flash comes with a small Library of sounds that you can use. They are the type of sounds that you would attach to a button so that when the button is clicked you also hear a 'click'. To access the sounds:
Go to: Window > Common Libraries > Sounds
This opens a panel with a list of sounds:

Common Sound Library
To Listen to the sounds:
There are a number of ways to get a sound from the common Library into your Movie.

A sound file in the movie Library after it has been dragged from one library
into the other.
Note: You cannot use the sound unless it is in your own movie Library.
Another way of getting a sound file into your movie is to drag it from the Common Library directly onto the Stage. Even though you drag onto the Stage you will find the sound in the time line!
![]()
A sound which has been dragged onto the Stage ends up in the TImeline.
Note: Once you dragged a sound onto the Stage you will find that it is in your own movie library. It will stay in your library even if you remove the sound from the timeline.
Importing an External Sound File
You cannot import any sound, it can only be certain file formats:
If QuickTime 4 (or later) is installed on your system, you can also import these:
To import a sound file into Flash go to either:
File > Import or
File > Import to Library
Browse to where your file is located.
Select a file and click: Open
It does not matter which Import method you use as either way
the file ends up in your library.
Event or Streamed Sound
Event
An event sound is one which plays to the end of the sound file no matter
what else is happening in your Flash movie. That means that once it starts to
play it cannot be turned off! For this reason event sounds are usually short.
The most common use for an event sound is to attach it to a button. When you
click the button it makes a sound - it's a bit like a door bell except it is
a button bell.
An event sound must be downloaded before it will play. This is important because sound files can be very large. This is another reason why event sounds tend to be short. Remember that once a particular sound has been used once, it can be used again and again without having to re-download. Therefore it is better (in download terms) to have a few sounds attached to many buttons than every button have it's own unique sound.
If somebody clicks on a button that has a sound attached and the sound has not yet downloaded the button will still work. It will just be silent.
Streamed
Streamed sound does not need to be downloaded to play. It downloads and plays
simultaneously. If you have sounds that are more than a few seconds long you
should used streamed sound. The disadvantage is that on a slow Internet connection
the sound/music may be of poor quality. You either have to make sure that the
sound is not played until the entire file has downloaded or accept that the
quality may not brilliant on all machines.
Cross Ref: One way to ensure that a sound file has completely downloaded is to use a preloader. See tutorial: Intermediate - Preloader
Steamed sound can also be switched on and off. All sounds go in the Timeline but a streamed sound can only be heard if the Timeline is being played. If you stop the movie from being played, the sound will stop. Also if you go to a different section of the movie, like a new scene, the sound will also stop playing.
Attaching an Event Sound to a Button
Example: Download
the Flash file Beg 021a
Click the button to hear the Event sound.




Attaching a Streamed Sound to the Timeline
Example: Download
the Flash file Beg 021b
Use the controls to Play, Pause and Stop the Streamed sound.
Credits: This sample file was submitted by Buffalo Audio: A site offering professional voice-over narration and custom music/sound effects.
Example: Download
the MP3 Sound file Beg 021c
To create a streamed sound in a Flash movie you will need a sound file. Although it is possible to use one of the sounds in the Common Sound Library, they are all very short, which is not very good for streamed sounds. If they are too short it makes it hard to test the movie. You can either download the MP3 file (Beg 021c) or use your own sound file. It can be any of the formats listed above.
Step One: Setting up the Document
Step Two: Creating the Streamed Sound


Step Three: The Control Buttons
We need three buttons for Play, Pause and Stop. There is no reason why you cannot create your own buttons, but for this tutorial I am going to use three buttons that are in the Common Library as it is quicker and easier.
Gel Right: |
Gel Pause: |
Gel Stop: |
Cross Ref: Sound files can make a Flash movie very large and means that the file maybe slow to download. To look at how you help keep your file sizes small, including sound compression see tutorial: Beginners - Optimizing a Flash Movie
Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates
•
98762 visitors to this page since Jan 04 |
|
|
All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.
|