Recipe 17.4. Synchronizing Sounds to Animation


Problem

You want to make sure that your sound remains synchronized with the animation.

Solution

Use the Stream setting for synchronizing your sound.

Discussion

Flash sounds can be synchronized a variety of ways, and each way has its own benefits. The streaming synchronization option is ideal when you want to make sure that that the Flash animation stays in step with the audio. When you select the Stream option for sound synchronization, Flash makes sure that the movie's timeline plays back along with the sound. If Flash cannot draw the frames fast enough, it will automatically drop frames to keep up with the sound. This is important if you have a single, long sound that acts as a narration or soundtrack that needs to be in sync with the visual elements.

Flash sounds default to the Event synchronization, so if you want your sound to synchronize using the Stream option, you need to explicitly tell Flash to do this. Select the keyframe that contains the sound, and in the Property inspector, select Stream from the Sync menu. That is all there is to it.

Setting a sound to synchronize using the Stream setting is a simple process; however, there are a few things you should be aware of with sounds set to this synchronization type. First of all, unlike sounds set to synchronize as Event or Start, those set to Stream play only as long as there are enough frames in the layer in which the sound has been placed. So when you use stream sounds, make sure that you have created enough regular frames (non-keyframes) on the same layer, directly following the keyframe with the sound. You will be able to see where the sound ends, because Flash places a waveform in the timeline for your convenience. Another thing to be aware of is that it is inadvisable to choose to loop these types of sounds. See Recipe 17.8 for further discussion.




Flash 8 Cookbook
Flash 8 Cookbook (Cookbooks (OReilly))
ISBN: 0596102402
EAN: 2147483647
Year: 2007
Pages: 336
Authors: Joey Lott

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