User Guide
Controlling sound playback using behaviors 207
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 > Development Panels > 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 205.
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 > Development Panels > Behaviors), click the Add (+) button.
3.
Select Sound > Play Sound.
4.
In the Play Sound dialog box, enter the instance name of the sound you want to play, and click
OK.
5.
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, leave the option unchanged.
To stop 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 > Development Panels > Behaviors), click the Add (+) button.
3.
Select Sound > Stop Sound.
4.
In the Stop Sound dialog box, enter the linkage identifier and the instance name of the sound
you want to stop, and click OK.
5.
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, leave the option unchanged.
To stop all sounds using a behavior:
1.
Select the object, such as a button, that you want to use to trigger the Stop All Sounds behavior.
2.
In the Behaviors panel (Window > Development Panels > Behaviors), click the Add (+) button.
3.
Select Sound > Stop All Sounds.
4.
In the Stop All Sounds dialog box, click OK to verify that you want to stop all sounds.
5.
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, leave the option unchanged.