Previous Page
Next Page

Importing Sounds into Flash

In the preceding section, we discussed the various sound formats that Flash 8 can import and export. In addition to covering the merits of the MP3 and Speech codecs, we also explained the uses of platform-specific AIF (Mac) and WAV (Windows) audio files. But we didn't delve into the process of importing sound into Flash 8. So, let's get started.

Note 

When working with sound, you may encounter some interchangeable terminology. Generally, these terms — sound file, sound clip, and audio file — all refer to the same thing, a single digital file in one of several formats, which contains a digitally encoded sound.

Unlike other imported assets, such as bitmaps or vector art, Flash won't automatically insert an imported sound file into the frames of the active layer on the timeline. In fact, you don't have to select a specific layer or frame before you import a sound file. That's because all sounds are sent directly to the Library immediately upon import, regardless of whether you use File ð Import ð Import to Stage or Import to Library. After import, the sound becomes part of the Flash document file (.fla), which may make the file size balloon significantly if the sound file is large. The sound does not become part of the Flash movie file (.swf), nor will it add to the size of the Flash movie unless it is assigned to a keyframe, as an instance of that sound, or it is set to export for use in ActionScript.

Tip 

Flash Players 6 and higher allow a Flash movie to load MP3 files directly. Earlier versions of the Flash Player required Macromedia Generator (or an equivalent server-side application) to transform sound files into Flash movie files (.swf) on the fly. We'll show you how to load and attach sounds with ActionScript in Chapter 28, "Sharing and Loading Assets."

To import a sound file into the Flash 8 authoring environment, follow these steps:

  1. Choose File ð Import ð Import to Library or Import to Stage (Ctrl+R or z+R). For sound assets, these commands work identically.

  2. From the Files of type list (Windows) or Show list (Mac) in the Import dialog box, select All Sound Formats.

    Caution 

    On the Mac OS X version of Flash 8, you may need to choose All Files in the Show menu in order to select an appropriate sound file.

  3. Browse to the sound file that you want to import.

    On the CD-ROM 

    If you're looking for a sample audio file, you can import the atmospheres_1.mp3 file found in the ch15 folder of this book's CD-ROM.

  4. Click Open.

    The sound file you select is imported into your Flash document file (.fla) and arrives in the document's library with its filename intact. If the Library panel is closed, you can open it by choosing Window ð Library, or by using the keyboard shortcut (Ctrl+L or z+L). With the Library panel open, locate the sound, and click it to highlight the name of the sound file where it appears in the Library list. The waveform appears in the Library preview pane, as shown in Figure 15-1. Click the Play button above the waveform to audition the sound.

Image from book
Figure 15-1: This is a stereo sound in the Flash document's library.
Cross-Reference 

Refer to the "Fine-Tuning Sound Settings in the Library" section, later in this chapter, for an explanation of how you can specify unique compression settings for each sound in a document's library.

You may also load sounds from a shared library. Refer to Chapter 28, "Sharing and Loading Assets," to learn more about shared libraries. Chapter 28 also shows you how to preload an MP3 file into a Flash movie file (.swf). To learn how to assign a linkage identifier string to an asset, such as a sound file, refer to Chapter 27, "Interacting with Movie Clips."

You can also import sound files into a Flash document by dragging the sound file from the desktop to the Library panel. On the Macintosh, you can drag the sound file to the Stage as well. This method can be especially useful when you have searched for a sound file using the operating system's search tool (Start ð Search in Windows, or Sherlock in the Mac OS), and want to quickly bring the sound file into Flash 8.


Previous Page
Next Page