Using Event Sounds


One of the sound settings available in the Frame Properties tab of the Property inspector is Sync. The Sync setting determines the way Flash synchronizes the sounds in your movie. Sync has four settings: Event, Start, Stop, and Stream. The default is Event.

Event sounds play independently of the main Timeline. Flash starts an event sound at a keyframe in a movie; the event sound plays until Flash reaches the end of the sound clip or encounters an instruction to stop playing that sound or all sounds. Long event sounds can continue to play after the playhead reaches the last frame in the movie. If your movie loops, every time the playhead passes a frame with an event sound, Flash starts another instance of that sound playing.

To understand how synchronization works, it's helpful to work in a file that has identifying text in keyframes.

To set up a file for testing sounds

1.

Create a 20-frame, 3-layer Flash document.

2.

Label the layers Objects, Sound 1, and Sound 2.

3.

In all layers, insert keyframes into frames 1, 5, 10, 15, and 20.

4.

In the Objects layer, place identifying text on the Stage for each keyframe.

5.

Import several sounds of different lengths into the file's library.

This example uses a 15.8-second sound clip of a musical-scale passage, a water drop sound, a melodic passage, and some rhythm sounds.

6.

Save the document as a template for use throughout this chapter, and name it SoundSyncTemplate.

For detailed instructions on saving documents as templates, see Chapter 1.

Independent Sounds vs. Synchronized Sounds

Unsynchronized sound clips play independently of the frames in a movie and can even continue playing after the playhead reaches the last frame in the movie. Flash starts these event sounds at a specific frame, but thereafter, event sounds play without relation to specific frames. On one viewer's computer, the sound may take 10 frames to play; on a slower setup, the sound may finish when only 5 frames have appeared.

Flash can also synchronize entire sound clips with specific frames. Flash breaks these stream sounds or streaming sounds into smaller pieces and attaches each piece to a specific frame. For streaming sounds, Flash forces the animation to keep up with the sounds. On slower setups, Flash draws fewer frames so important actions and sounds stay together.


To make an assigned sound an event sound

1.

Open a new copy of SoundSyncTemplate, created in the preceding task.

2.

In the Timeline, select keyframe 5 of the Sound 1 layer (Figure 15.12).

Figure 15.12. Select the keyframe to which you want to assign a sound. Settings that you create in the Frame Properties tab of the Property inspector are applied to the selected keyframe.


3.

In the Frame Properties tab of the Property inspector, from the Sound pop-up menu, choose the sound named Scale.AIFF (Figure 15.13).

Figure 15.13. In the Frame Properties tab of the Property inspector, choose a sound from the Sound pop-up menu.


4.

From the Sync pop-up menu, choose Event (Figure 15.14).

Figure 15.14. From the Sync pop-up menu, choose Event to make the assigned sound start in the selected keyframe and play to the end of the sound, without synchronizing to any subsequent frames of the movie.


The Scale.AIFF sound is assigned to keyframe 5 of the Sound 1 layer.

5.

Position the playhead in keyframe 1, and play your movie (choose Control > Play).

In a movie that has a standard frame rate of 12 frames per second (fps), the 15.8-second Scale sound continues to play after the playhead reaches the last frame of the movie.

Tip

  • To understand better how Flash handles event sounds, choose Control > Loop Playback. Now play the movie again, and let it loop through a couple of times. Each time the playhead enters keyframe 5, Flash starts another instance of the Scale sound, and you begin to hear not one set of notes going up the scale, but a cacophony of bad harmonies. When you stop the playback, each sound instance plays out until its endan effect sort of like people singing a round.


To play overlapping instances of the same sound

1.

Using the file you created in the preceding task, to assign a sound to a later point in the movie's Timeline, do either of the following:

  • Select keyframe 15 of the Sound 1 layer.

  • Select keyframe 15 of the Sound 2 layer.

Because Flash starts a new instance of an event sound even if that sound is already playing, you have the choice of adding a second instance to the same layer as the first or adding it to a different layer.

2.

In the Frame Properties tab of the Property inspector, from the Sound pop-up menu, choose the sound named Scale.AIFF.

3.

From the Sync pop-up menu, choose Event.

The Scale.AIFF sound is assigned to keyframe 15 of whichever layer you chose (Figure 15.15).

Figure 15.15. You can add a second instance of your sound and make it play on top of the first. Event sounds play independent of the main Timeline, so you're free to add the second sound to the same layer as the first (top). Alternatively, you can add the second sound to its own layer (bottom).


4.

Position the playhead in keyframe 1, and play your movie one time.

When the playhead reaches keyframe 5, the Scale.AIFF sound starts. When the playhead reaches keyframe 15, another instance of the Scale.AIFF sound starts, and the two sounds play together (you hear two voices). When the first instance ends, you again hear only one voice. Within a single layer, each frame can contain only one sound. To make Flash begin playing different sounds at the same point in a movie, you must put the sounds in separate layers.

5.

Save this file for use in a later task; name it OverlapSnds.fla.

To start different sounds simultaneously

1.

Open a new copy of the SoundSyncTemplate you created earlier in this chapter.

2.

In the Timeline, select keyframe 5 of the Sound 1 layer.

3.

In the Frame Properties tab of the Property inspector, from the Sound pop-up menu, choose Scale.AIFF.

4.

From the Sync pop-up menu, choose Event.

5.

In the Timeline, select keyframe 5 of the Sound 2 layer.

6.

In the Frame Properties tab of the Property inspector, from the Sound pop-up menu, choose a different sound.

You can also import a new sound to your movie's library or open the Library panel of another movie containing the sound you want to use and then drag a copy of the sound to the Stage. This example uses a sound named Melody.AIFF.

Flash places the waveform for the second sound in keyframe 5 of the Sound 2 layer (Figure 15.16).

Figure 15.16. To make two different sounds begin playing simultaneously, you must put each sound in a different layer in a keyframe at the same spot in the Timelinefor example, keyframe 5.


7.

In the Frame Properties tab of the Property inspector, from the Sync pop-up menu, choose Event.

8.

Position the playhead in keyframe 1, and play your movie one time.

When the playhead reaches keyframe 5, Flash starts playing the Scale.AIFF and Melody.AIFF sounds simultaneously.

Tip

  • All the information required to play an event sound lives in the keyframe to which you assigned that sound. When you play the movie, Flash pauses at that keyframe until all the information has downloaded. It's best to reserve event syncing for short sound clips; otherwise, your movie may be interrupted by long pauses for downloading sounds.





Macromedia Flash 8 for Windows & Macintosh Visual QuickStart Guide
Macromedia Flash 8 for Windows & Macintosh
ISBN: 0321349636
EAN: 2147483647
Year: 2005
Pages: 204

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net