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

Chapter 8. Controlling Sound > Using the Sound Class

Using the Sound Class

Attaching a sound file to a keyframe in the Timeline is an easy way to incorporate sounds into your movie. Two common ways to integrate sound on the Timeline are to use the Event Sync option to play a clicking sound in the Down state of a button symbol and to use the Stream Sync option to synchronize dialogue with an animation. But if you need to control when a sound plays at run-time, change its volume and playback through the left and right speakers dynamically, or retrieve information about the number of seconds it has been playing, turn to the Sound class.

The methods of the Sound class control a sound’s playback behavior, and the properties of the Sound class can help you control its timing and gather MP3 file information. You need to instantiate the Sound class by using a constructor function to give it a name, just as you did with the Color class in Chapter 7. When a sound object is named, you’ll be able to use it to play and modify sound files that you associate with it.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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