Adding Sound > Adding sounds to a movie |
![]() ![]() ![]() |
Adding sounds to a movie
To add a sound to a movie from the library, you assign the sound to a layer and set options in the Sound controls in the Property inspector. It is recommended that you place each sound on a separate layer.
You can load a sound into a movie during runtime, using the loadSound
method of the Sound object. See Sound (object) in the ActionScript Dictionary.
To test sounds that you add to a movie, you can use the same methods you use to preview frames or test movies: drag the playhead over the frames containing the sound, or use commands in the Controller or the Control menu. See Previewing and testing movies.
To add a sound to a movie:
1 |
Import the sound into the library if it has not already been imported. See Importing sounds. |
2 |
Choose Insert > Layer to create a layer for the sound. |
3 |
With the new sound layer selected, drag the sound from the Library panel onto the Stage. The sound is added to the current layer. |
You can place multiple sounds on one layer, or on layers containing other objects. However, it is recommended that each sound be placed on a separate layer. Each layer acts like a separate sound channel. The sounds on all layers are combined when you play back the movie. |
|
4 |
In the Timeline, select the first frame that contains the sound file. |
5 |
Choose Window > Properties and click the arrow in the lower right corner to expand the Property inspector. |
6 |
In the Property inspector, choose the sound file from the Sound pop-up menu. |
7 |
Choose an effect option from the Effects pop-up menu: |
![]() |
None applies no effects to the sound file. Choose this option to remove previously applied effects. |
![]() |
Left Channel/Right Channel plays sound in the left or right channel only. |
![]() |
Fade Left to Right/Fade Right to Left shifts the sound from one channel to the other. |
![]() |
Fade In gradually increases the amplitude of a sound over its duration. |
![]() |
Fade Out gradually decreases the amplitude of a sound over its duration. |
![]() |
Custom lets you create your own In and Out points of sound using the Edit Envelope. See Using the sound-editing controls. |
8 |
Choose a synchronization option from the Sync pop-up menu: |
![]() |
Event synchronizes the sound to the occurrence of an event. An event sound plays when its starting keyframe is first displayed and plays in its entirety, independently of the Timeline, even if the movie stops. Event sounds are mixed when you play your published movie. |
An example of an event sound is a sound that plays when a user clicks a button. If an event sound is playing and the sound is instantiated again (for example, by the user clicking the button again) the first instance of the sound continues to play and another instance begins to play simultaneously. |
|
![]() |
Start is the same as Event, except that if the sound is already playing, no new instance of the sound is played. |
![]() |
Stop silences the specified sound. |
![]() |
Stream synchronizes the sound for playing on a Web site. Flash forces animation to keep pace with stream sounds. If Flash can't draw animation frames quickly enough, it skips frames. Unlike event sounds, stream sounds stop if the movie stops. Also, a stream sound can never play longer than the length of the frames it occupies. Stream sounds are mixed when you publish your movie. |
An example of a stream sound is the voice of a character in an animation that plays in multiple frames. |
|
Note: If you use an MP3 sound as a stream sound, you must recompress the sound for export. You can choose to export the sound as an MP3 file, with the same compression settings that it had on import. See Compressing sounds for export. |
|
9 |
Enter a value for Loop to specify the number of times the sound should loop. |
For continuous play, enter a number large enough to play the sound for an extended duration. For example, to loop a 15-second sound for 15 minutes, enter 60. |
|
Note: Looping stream sounds is not recommended. If a stream sound is set to loop, frames are added to the movie and the file size is increased by the number of times the sound is looped. |
![]() ![]() ![]() |