Chapter 2. Adding Sound to a Flash Production

In This Chapter

  • Importing audio to your projects

  • Adding sound to your projects

  • Adding sound to buttons

  • Using ActionScript to load an external sound file or a soundtrack

It seems like every Flash movie has sound in it. Flash sites have background music playing, and buttons make noise when they're clicked, for example. If you want sound in your Flash projects, you've come to the right place. In this chapter, we show you how to import audio, add audio to keyframes, and add audio to buttons. Last but not least, we show you how to use ActionScript to load a music soundtrack.

Importing Audio

If you want music in a Flash project, you have to import it — it's a Flash law. When you import music to a project, you can import it to the Stage or to the document library.

Importing Audio

To import a sound to the document library:

  1. Choose File

    Importing Audio

    The Import to Library dialog box appears (see Figure 2-1).

  2. Select the file you want to import.

    You can import any sound file format supported by Flash. If you don't have your sound assets organized in their own folder, you can save time by choosing All Sound Formats from the Files of Type drop-down menu. When you choose this option, only supported sound files are displayed in the dialog box. Alternatively, you can select a file format type from ...

Get Flash CS4 All-in-One For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.