Flash 5 Tutorial: Part 2
August 10, 2001
|
This is the second in a series of articles to help users
learn how to use Flash 5.
|
In this second installment we will discuss how to import and use
sounds inside Flash files and how to manipulate objects to cause
them to flip and do other things.
We will begin by discussing how Flash can use sounds to enhance a
users experience. Sounds can play continuously —
independent of the timeline of the movie — or can be
synchronized with the animation to create a sound track. Sounds
can be attached to buttons in order to give them a more
interactive feel. Sounds can be set up in shared libraries so
that a sound from one library can be used in multiple movies.
Playback can be controlled with ActionScript.
Sounds can be dealt with in two different ways —
streaming and event sounds. Streaming sounds begin
playing as soon as enough data for the first few frames have been
downloaded. These are synchronized to the Timeline for playing in
sync with the Flash file on the Web site. Event sounds must
download entirely before they begin to play. They will continue
to play until a 'Stop' action is encountered.
There are also compression options to control the quality and
size of the sounds in the final exported movies. Each individual
sound can have the compression options changed by using the
'Sound Properties' dialog box. In order to define the settings
for all sounds in the movie simply use the 'Publish
Settings' dialog box.
Sound files can be imported from another source. In order to do
this use the [File > Import] command from the menu bar at the
top. Windows users can import WAV files, while Macintosh users
can import AIFF files. Both operating systems can import MP3
files. If you have QuickTime 4 (or a later version), additional
sound file formats can be imported:
- Sound only QuickTime Movies (Both Windows and Macintosh)
- System 7 Sounds (Macintosh Only)
- Sound Designer II (Macintosh Only)
- Sun AU (Both Windows and Macintosh)
- WAV Files (Both Windows and Macintosh)
Once the sound file is imported into the movie it shows up in the
library along with the bitmaps and symbols that are there.
One thing that needs to be remembered is that sound can use
considerable amounts of both disk space and RAM. One of the best
audio formats is MP3 files, which are more compressed and smaller
than WAV or AIFF sound files. When using WAV or AIFF files, it is
best to use 16-bit 22 kHz mono sounds (stereo uses twice as much
data as data as mono). However, Flash can import either 8- or 16-
bit sounds at sample rates of 11 kHz, 22 kHz, or 44 kHz. When the
file is exported Flash can convert the sounds to lower sample
rates.
To import a sound file select [File > Import]. In the import box
that appears locate and open the desired sound file. The imported
sound is then placed in the library for the current movie to use.
To add the sound to a movie assign a sound to a layer and set the
options in the 'Sound Panel'. In order to keep the movie
file as organized as possible it is recommended to place the
sound file on it's own separate layer. To create a new layer for
the sound select [Insert > Layer] from the menu options. With the
new layer selected drag the sound from the library onto the
'Stage'. This allows the sound to be added to the current
layer. Multiple sounds can be placed on one layer, or on layers
containing other objects. Like mentioned before it is recommended
that each sound be placed on a separate layer. Each one of these
layers acts like a separate channel for the sounds.
In order to view the sound panel, select [Window > Panels >
Sound]. Select a sound file from the 'Sound' menu
selection. There are numerous ways to change the sound from the
pop-up menu. The first selection is 'None' which means
that there is no effect on the audio — also choose this
option to remove any previously applied effects to the sound.
Select 'Fade In' to gradually increase the volume of a
sound over duration of time. 'Fade Out' gradually
decreases the volume of the sound over the duration of time.
There are also 'Left Channel' and 'Right Channel'
options that play the sound file in the selected channel/speaker
only. One of the more interesting effects that can be used is the
'Fade Left to Right' or 'Fade Right to Left', which
shifts the audio from one speaker to the other.
The same dialog box can be used to specify the number of times
the sound loop should play. If you are going to want continuous
play, enter a number large enough to play the sound an extended
duration. For example, if you want to loop a 15 second sound for
the entire time that the user is going to be at the site, enter a
high number, i.e. 99, and it will simply loop over and over
again.
When creating buttons sounds can also be associated with
different states of the symbol. Due to the fact that the sound is
stored within the symbol, the audio will be heard for all
instances of that symbol.
In order to do this, simply select the button from the library
and choose [Edit] from the options menu. In the timeline of the
button, add another layer for the sound to be placed. Now, you
must decide at what stage of the button you want the sound to be
heard. If you want the sound to be heard when the user moves the
mouse over the button, add a keyframe there. If you want the
sound when the user clicks on the button you want to add the
keyframe there. Whatever instance you want the sound to occur
simply select the sound from the library and drag it onto the
stage. At the same time if you want to have different sounds for
different states of the button, just add another keyframe and
sound for that state.
Flash 5 Tutorial: Part 1
Flash 5 Tutorial: Part 2 - Page 2
|