• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 11. Working with Sounds > Using Audio with ActionScript Behaviors

Using Audio with ActionScript Behaviors

Sound is a great motivator. For example, a particular piece of music can make you happy, or it can make you sad. In addition, sounds can pull out childhood memories, and can stir emotions. Sound is a powerful tool, however, different people react differently to sounds, therefore it's important that you think carefully about the sounds you add to your movies, and it's equally important to understand how you can control your movies using ActionScript Behaviors.

Load a Sound from the Library

Click the Window menu, and then click Library.

Select an audio file from the available Library items.

Click the Library Options button, and then click Linkage.

Select Export For ActionScript.

Enter a distinctive name for the Identifier field or use the default.

Leave the other fields at their default values, and then click OK.

Click the Window menu, point to Development Panels, and then click Behaviors.

Select a button object on the Stage or Timeline keyframe.

Click the plus (+) sign, located in the upper-left portion of the Behaviors panel, point to Sound, and then click Load Sound From Library.

Enter the name of the audio file in the Linkage ID field.

Enter a unique name in the instance field.

Select Play This Sound When Loaded.

Click OK.

Select an Event to trigger the sound.

IMPORTANT If the audio file was added to a Timeline frame, the event field will be disabled.

Click the Control menu, and then click Test Movie to test the ActionScript.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint