• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 7. Working with Sound and Video > Adding Sound to Your Movie

Adding Sound to Your Movie

The first thing you need to know is that sounds must be attached to a keyframe. Whether you're dealing with a keyframe in a timeline or a keyframe in a button state, the sounds must be placed a keyframe. With that established, let's get in and get our hands dirty.

Adding Sound to a Button

The point of this exercise is to get you more familiar with how sounds work and where you put them in your movie. In this exercise we will add a sound to a button so that when the end user clicks the button, a small camera sound will play. This does two things: First, it's an aural indicator to end users that they successfully clicked the button. Second, if used properly, it will create an experience for the end users that make them believe the button has physical qualities and actually makes that noise when clicked! This is the ultimate goal in Flash development—making the end users forget for a moment that they are actually sitting at their desks, believing that they're in the space you created. Sound can play a huge role in creating this illusion.

To add sound to a button, follow these steps:

Create a new document. Save this file as loudButton.fla.

You can either create your own button or use a stock one from the common libraries. Choose Window, Other Panels, Common Libraries, Buttons. Choose any button you like and drag an instance of it out onto the stage.

Even though I just gave you a speech about not using stock Flash sounds, that's exactly what we're going to do here! However, I am not recommending that you publish this project. It's simply a learning tool.

Choose Window, Other Panels, Common Libraries, Sounds to open the Sounds common library. Notice that you can preview the sound by clicking the Play button in the Preview window of the library, as shown in Figure 7.1. Preview the various sounds until you find the one you like.

Figure 7.1. Preview sounds by clicking the Play button. Stop them by clicking the Stop button.

Double-click the button to go into the button symbol's editing mode. Inside the button, create a new layer and name it sound.

Insert a keyframe in the Down state on the sound layer. Notice the hollow circle in the frame, which indicates that there is no content in this frame and on this layer. This is the frame we're going to use to add the sound.

With the sound layer still active and the play head on the Down state, drag the sound from the library and drop it on the stage. Notice the small waveform inside the Down state, as shown in Figure 7.2, indicating that there is a sound on that frame. If you have the frame selected, notice that the Properties Inspector offers some sound options.

Figure 7.2. The waveform indicates that there is indeed a sound on the frame.

Come back to scene 1 and test the movie by choosing Control, Test Movie.

Click the button to hear the sound. Not bad, huh?



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint