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

Chapter 8. Controlling Sound > Modifying Sounds

Modifying Sounds

When you use the Sound object, Flash gives you full control over the volume of sound and its output through either the left or right speaker, known as pan control. With this level of sound control, you can let your users set the volume to their own preference, and you can create more realistic environments. For example, in a car game, you can vary the volume of cars as they approach or pass you. Playing with the pan controls, you can embellish the classic Pong game by making the sounds of the ball hitting the paddles and the walls play from the appropriate sides.

The two methods for modifying sounds are setVolume and setPan. SetVolume takes a number between 0 and 100 as its argument, where 100 is the loudest and 0 is silence. setPan takes a number between –100 and 100, where –100 plays the sound completely through the left speaker, 100 plays the sound completely through the right speaker, and 0 plays the sound through both speakers equally.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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