Use a behavior to play an mp3 file

When you want to add interactivity to your document with ActionScript, you can often rely on behaviors to add the ActionScript for you. You'll use a sound behavior to play an MP3 file from the library.

  1. In the Library panel, right-click (Windows) or Control-click (Macintosh) ping.mp3 and select Linkage from the context menu.
  2. In the Linkage Properties dialog box, select Export for ActionScript and verify that Export in First Frame is selected.
  3. Verify that ping.mp3 appears in the Identifier text box, and click OK.
  4. On the Stage, select the playSound_btn instance.
  5. In the Behaviors panel (Window > Development Panels > Behaviors), click the Add (+) button and select Sound > Load Sound from Library.
  6. In the linkage ID text box, enter ping.mp3, and in the Name text box below, enter ping. Then click OK.