318
Working with Sound
Controlling sound playback using
behaviors
You can control sound playback using sound behaviors. Behaviors are prewritten ActionScript
scripts that you apply to an object, such as a button, to control a target object, such as a
sound. Behaviors enable you to add the power, control, and flexibility of ActionScript coding
to your document without having to create the ActionScript code yourself.
You can use the Load Sound from Library or Load Streaming MP3 File behaviors to add a
sound to your document. Adding a sound using these behaviors creates an instance of the
sound. The instance name is then used to control the sound.
The Play Sound, Stop Sound, and Stop All Sounds behaviors let you control sound playback.
To use these behaviors, you must first load a sound with one of the Load behaviors. To play or
stop a sound with a behavior, you use the Behaviors panel to apply the behavior to a triggering
object, such as a button. You specify the event that triggers the behavior (such as clicking the
button), select a target object (the sound to be affected by the behavior), and select settings for
the behavior parameters to specify how the behavior executes.
To load a sound to a file using a behavior:
1.
Select the object, such as a button, that you want to use to trigger the behavior.
2.
In the Behaviors panel (Window > Behaviors), click the Add (+) button and select Sound
> Load Sound from Library or Sound > Load Streaming MP3 File.
3.
In the Load Sound dialog box, enter the linkage identifier for a sound from the Library, or
the sound location for a streaming MP3 file. Next, enter a name for this instance of the
sound, and click OK.
For information on linkage identifiers, see
“Using sounds with Sound objects”
on page 316
.
4.
In the Behaviors panel under event, click On Release (the default event), and select a mouse
event from the menu. If you want to use the
OnRelease
event, do not change the option.
To play a sound using a behavior:
1.
Select the object, such as a button, that you want to use to trigger the Play Sound behavior.
2.
In the Behaviors panel (Window > Behaviors), click the Add (+) button.
3.
Select Sound > Play Sound.
NO
TE
Flash Lite 1.0 and Flash Lite 1.1 do not support behaviors.
Summary of Contents for FLASH 8-FLASH
Page 1: ...Using Flash ...
Page 12: ...12 Contents ...
Page 110: ...110 Using Symbols Instances and Library Assets ...
Page 128: ...128 Working with Color Strokes and Fills ...
Page 156: ...156 Drawing ...
Page 190: ...190 Working with Text ...
Page 224: ...224 Working with Graphic Objects ...
Page 270: ...270 Creating Motion ...
Page 310: ...310 Working with Video ...
Page 362: ...362 Working with Screens Flash Professional Only ...
Page 386: ...386 Creating Multilanguage Text ...
Page 454: ...454 Data Integration Flash Professional Only ...
Page 500: ...500 Publishing ...
Page 534: ...534 Creating Accessible Content ...