Control sounds using behaviors

Using sound behaviors, prewritten ActionScript 2.0, you can add sounds to your document and control sound playback. Adding a sound using these behaviors creates an instance of the sound, which is then used to control the sound.

Note: ActionScript 3.0 and Flash Lite 1.x and Flash Lite 2.x do not support behaviors.

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.
  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.

Play or stop sounds 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.
  3. Select Sound > Play Sound, Sound > Stop Sound, or Sound > Stop All Sounds.
  4. In the dialog box that appears, do one of the following:
    • Enter the linkage identifier and the instance name of the sound you want to play or stop, and click OK.

    • 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, do not change the option.

  This page on the Web