Starting And Stopping Sounds At Keyframes; About The Onsoundcomplete Event - MACROMEDIA FLASH MX 2004-USING FLASH Use Manual

Hide thumbs Also See for FLASH MX 2004-USING FLASH:
Table of Contents

Advertisement

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:
Add a sound to a document. For more information, see
1.
on page
203.
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.
Create a keyframe in the sound layer's Timeline at the frame where you want the sound to end.
2.
A representation of the sound file appears in the Timeline.
Select Window > Properties and click the arrow in the lower right corner to expand the
3.
Property inspector.
In the Property inspector, select the same sound from the Sound pop-up menu.
4.
Select Stop from the Synchronization pop-up menu.
5.
When you play the SWF file, the sound stops playing when it reaches the ending keyframe.
To play back the sound, simply move the playhead.
6.

About the onSoundComplete event

The
onSoundComplete
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 class" in Flash
ActionScript Language Reference. The
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.
The
onSoundComplete
the following:
Creating a dynamic playlist or sequencer
Creating a multimedia presentation that checks for narration completion before advancing to
the next frame or scene
Building a game that synchronizes sounds to particular events or scenes and transitions
smoothly between different sounds
Timing an image change to a sound—for example, changing an image when a sound is
half over
208
Chapter 11: Working with Sound
event of the ActionScript Sound object lets you trigger an event in a Flash
onSoundComplete
event lets you manipulate sounds in a variety of powerful ways, such as
"Adding sounds to a document"
event of a Sound object is invoked
onSoundComplete
property is a read-only property
position
event. The

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents