CONTROLLING SOUND WITH ACTIONSCRIPT


Although most of us can enjoy listening to music without thinking too much about what we're hearing, the vibrations that make up even the most elementary sounds are actually far from simple a fact made evident by the processing power requirements of most audio-editing programs. However, despite the complexity of even the most simple audio clip, sounds can be broken down into just three basic characteristics:

  • Length. A sound's length can provide sensory cues about size (the short chirp of a small-car horn compared to the roar of a semi-truck's horn) and urgency (the tinkle of a viciously shaken dinner bell compared to the long bong of a lazy Sunday church bell).

  • Volume. A sound's volume provides clues about distance. Louder sounds give the feeling of closeness, whereas quiet sounds imply distance. A sound that gradually goes from quiet to loud, or vice versa, creates a sense of movement.

  • Panning. Panning represents the position of the sound from left to right. As with volume, this sound characteristic allows you to determine the relative position of the element making the sound. If you were to close your eyes at a tennis match, you could accurately determine the position of the ball (left or right of the net) simply by the "pop" of the ball being smacked by the racket.

With Flash, you can control these various sound characteristics simply by editing sound instances on the timeline a solution that works well for presentations that don't require audience or user participation. However, if you want to give your user control allowing them to move and slide things around you need a more dynamic solution. Fortunately, you can easily emulate and control all of these sound characteristics via ActionScript.



Macromedia Flash MX ActionScripting Advanced. Training from the Source
Macromedia Flash MX ActionScripting: Advanced Training from the Source
ISBN: 0201770229
EAN: 2147483647
Year: 2002
Pages: 161

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net