How to Add Audio to Flash (MX & Flash 8)

Before you even think about adding audio to Flash, you should spend a significant amount of time recording, editing and optimizing your audio in a separate audio program. Flash is not an audio editor.

One other thing: For the purposes of this project, I'm assuming your audio clip is saved in the MP3 format (.mp3). This tutorial will only work with MP3 sound clips.

With these caveats out of the way, let's get to it!

  1. Import your audio clip into Flash by going to File > Import > Import to Library.

  2. In the box that pops up, navigate to the folder containing your audio clip, click on your audio file and then click the Import to Library button.

  3. Your audio clip will be imported into the Flash library. This process can take a while if your clip is long.

  4. When the audio clip has fully imported, confirm that it is in the library.

  5. Go to Window > Development Panels > Components (in some versions of Flash you should go to Window > Components). Look for the Media Components section. Under this section, click once on the MediaPlayback component and drag an instance of this component to the stage. (Note: I'm assuming you have already determined where you want your audio clip to appear within your Flash project; if you haven't, you should go back and build your layers, keyframes and frame labels).

  6. Click on the MediaPlayback component on the stage. In the Properties box, look for the "Instance Name" text area. You should type in a relevant name in this box ("Audio" is a good one).

  7. In the properties box, click on the Parameters tab. Then click the Launch Component Inspector button.

  8. A window will pop up. You should select the following options in this window:

    • URL: This is an important one. Type the exact file name for your audio clip in this box. If you used capitilzation in the file name, use the same capitalization in the name you insert into the URL area. Your file name should have the extension .mp3 (example: roar.mp3).

    • Automatically Play: Uncheck this box.

    • Use Preferred Media Size: If this is checked, leave it. If it's not checked, leave it. We're not going to worry about this one.

    • Respect Aspect Ratio: If this is checked, leave it. If it's not checked, leave it. We're not going to worry about this one.

    • Control Placement: Bottom.

    • Control Visibility: On.

    • That's it for the Component Inspector. Close the window and return to the Stage.

  9. Test your movie (CTRL + Enter or Control > Test Movie). The controls for your audio clip should now be on the screen. Press the "Play" button to start the clip.

  10. Troubleshooting: Why won't my audio clip play?

    You need to be completely sure that all of your files are in the same folder. If they aren't, Flash won't know where to look for your .mp3 file.

  11. That's it! You can see the output from this tutorial here

Share this

Related Posts

Previous
Next Post »