Starting and stopping sounds at
keyframes
The most common sound-related task in Flash is starting and stopping sounds at keyframes to
synchronize with animation.
To stop and start a sound at a keyframe:
1.
Add a sound to a document. For more information, see
on page
313.
To synchronize this sound with an event in the scene, select a beginning keyframe that
corresponds to the keyframe of the event in the scene. You can select any of the
synchronization options.
2.
Create a keyframe in the sound layer's Timeline at the frame where you want the sound to
end.
A representation of the sound file appears in the Timeline.
3.
Select Window > Properties and click the arrow in the lower right corner to expand the
Property inspector.
4.
In the Property inspector, select the same sound from the Sound pop-up menu.
5.
Select Stop from the Synchronization pop-up menu.
When you play the SWF file, the sound stops playing when it reaches the
ending keyframe.
6.
To play back the sound, simply move the playhead.
About the onSoundComplete event
The
onSoundComplete
Flash application based on completing an attached sound file. The Sound object is a built-in
object that lets you control sounds in a Flash application. For more information, see
Sound in the ActionScript 2.0 Language Reference. The
Sound object is invoked automatically when the attached sound file finishes playing. If the
sound is looped a specified number of times, the event is triggered when the sound finishes
looping.
The Sound object has two properties that you can use with the
property is a read-only property representing the duration, in milliseconds, of the
duration
sound sample attached to the sound object. The
representing the number of milliseconds the sound has been playing in each loop.
320
Working with Sound
event of the ActionScript Sound object lets you trigger an event in a
"Adding sounds to a document"
onSoundComplete
onSoundComplete
property is a read-only property
position
event of a
event. The
Need help?
Do you have a question about the FLASH 8-USING FLASH and is the answer not in the manual?