Audio has long been an important part of the Flash world for designers and developers alike. From MP3 jukeboxes to presentation voice-overs and sound effects, audio is as much a part of some Flash files as the vectors on which they are based. Of course, used injudiciously, sound can be an annoyance. However, well-planned sound can add a lot to games, applications, and demos.
From a programming standpoint, ActionScript 3.0 introduces a whole new level of sound management. It’s now possible, for example, to more easily control Flash’s 32 independent channels of audio, determine the amplitude of mono and stereo sounds, and control Flash properties based on data from sounds playing in real time.
Even without ActionScript, Flash is no slouch in the audio department. You can add sounds to animation and button timelines, play them while downloading, and even edit them to a minimal degree, right within Flash. You can pan sounds back and forth between the left and right stereo channels, set them to any volume, and loop them.
In this chapter, you’ll learn how to import and embed sounds for use in the Timeline and how to play external sounds with ActionScript. You’ll also learn how to apply simple effects with the Flash interface and code and optimize sound compression. Finally, you’ll complete the sound controller you created in Chapter 3 for the portfolio project.
For a complete picture of Flash’s support for file formats, this discussion is ...