Introduction to Flash MX Tutorial > Add streaming and event sounds > Add an event sound to a button

 

Add an event sound to a button

In addition to dragging a sound to the Stage, you can select a sound from the Property inspector. You will use this method to add an event sound to a button.

As you learned in the Creating Buttons lesson, when you create a button symbol, Flash creates frames for the different button states in relation to the mouse pointer. The Over frame, for example, represents the button's state when the pointer is over the button. Other button frames/states are Up, Down, and Hit.

Now you'll add an event sound to a button, which causes the sound to play during the Over state. Because you're adding the sound to the button symbol in the library, not just to an instance of the symbol, the sound will play for each instance of the button.

1

In the Library panel, double-click the Button 1 instance to open symbol-editing mode.

2

In the Timeline for Button 1, add a new layer and name the new layer Sound.

3

Select the Over frame (Frame 2) of the Sound layer and choose Insert > Keyframe or press F6.

4

To define the sound properties, click Frame 2 of the Sound layer. In the Property inspector, select Ping.mp3 from the Sound pop-up menu. Verify that Event is selected in the Sync pop-up menu.

5

Save your document and choose Control > Test Movie to hear the button sounds. When you finish viewing the SWF file, close its window to return to the document.