Adding Sounds to Buttons


Auditory feedback helps people who view your Flash creation interact with buttons correctly. For buttons that look like real-world buttons, adding a click sound to the Down frame provides a more realistic feel. For more fanciful buttons or ones disguised as part of the scenery of your movie, adding sound to the Over frame lets users know they've discovered a hot spot.

To enhance buttons with auditory feedback

1.

Open a Flash document containing a button symbol to which you want to add sound.

(To learn about working with button symbols, see Chapter 12.)

2.

Open the file's Library panel (choose Window > Library), and select the button symbol you want to modify.

3.

From the Library panel's Options menu, choose Edit.

Flash opens the button in symbol-editing mode.

4.

In the button symbol's Timeline, add a new layer (click the Add Layer button), and name it Sound.

5.

In the Sound layer, select the Over and Down frames, and choose Modify > Timeline > Convert to Blank Keyframes (Figure 15.10).

Figure 15.10. Add a new layer for the sounds in a button symbol. In that layer, create keyframes for the button states where you plan to assign sounds.


6.

Using the techniques described in "Adding Sounds to Frames," earlier in this chapter, assign a sound to the _over frame and a different sound to the _down frame.

Flash displays as much of the waveform as possible in each frame. When you add sounds to buttons, it makes sense to increase the height of the layer that contains sounds (Figure 15.11). Make sure that the sound's Sync property is set to Event (the default) in the Property inspector. (You'll learn more about setting the Sync property in the next section.)

Figure 15.11. Flash displays the waveform of the assigned sound in the keyframe. Unlike movie Timelines, button symbol Timelines have no in-between frames that can contain part of the waveform. Increasing the layer height for a button symbol's Sound layer enlarges any waveforms in the button's frames, letting you see more detail.


7.

Return to document-editing mode.

Every instance of the button symbol in the document now has sounds attached.

8.

To hear the buttons in action, choose Control > Enable Simple Buttons.

When you move the pointer over the button, Flash plays the sound you assigned to the _over frame. When you click the button, you hear the sound you assigned to the _down frame.

Tips

  • The most common frames to use for button feedback are the _over and _down frames, but you can add sounds to any of the button symbol's frames. Sounds added to the _up frame play when the pointer rolls out of the active button area. Sounds added to the Hit frame play when you release the mouse button within the active button area.

  • You can also add sounds to movie-clip buttons, such as those you learned about in Chapters 12 and 13. As in this task, you add a sound layer to the symbol and then add sounds to the relevant keyframes in the movie-clip symbol. If you add a sound to the _up frame of a movie-clip button, the sound plays whenever the button first displays its _up framefor example, when the playhead reaches the frame containing the movie-clip button.





Macromedia Flash 8 for Windows & Macintosh Visual QuickStart Guide
Macromedia Flash 8 for Windows & Macintosh
ISBN: 0321349636
EAN: 2147483647
Year: 2005
Pages: 204

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net