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

Hour 13. Making Buttons for Your User to... > Task: Create a Button with a Roll Ov...

Task: Create a Button with a Roll Over Sound Effect

In a new file, draw a rectangle shape, convert it into a symbol (select Insert, Convert to Symbol), name it Audio Button, and make sure that you click Button Behavior before clicking OK.

Let's go edit the button. Double-click the instance so we can edit the master button.

Now that we're inside the master version of the button, we can concern ourselves with the Over state (where we'll include a sound). Of course we'll need a new keyframe in the Over state as sounds are only placed in keyframes. However, before we insert a keyframe (which, if inserted now, would copy the shape from the Up frame), let's convert the shape in the Up frame to a symbol (select it all, select Insert, Convert to Symbol, name it Shape of Button, and click OK).

Insert a keyframe in the Over frame. (You can tint Shape of Button or scale it if you want a visual effect when the user rolls over the button.) We'll also place a sound in this frame. With the Over frame selected, access the Properties panel. Notice that you won't find any sounds listed from the Sound drop-down list because we haven't imported any (see Hour 10, “Including Sound in Your Animation”).

Instead of importing a sound from a file, let's use one that comes with Flash. From Window, Common Libraries, select Sounds. Open your file's Library (select Window, Library or press Ctrl+L) and drag the Breaker Switch sound item into your Library. Now select the Over frame and use the Properties panel to select Breaker Switch (because it's been imported into your file), as shown in Figure 13.9.

Figure 13.9. On the Over state of our button we specify a Sound to play.

It should work. Of course you'll need to test the movie to see (and hear) it work. (Save this file, as we'll use it in our next task.)

That wasn't so bad. Just put a sound in the keyframe of the Over state of a button! I suggested the Breaker Switch sound in particular for two reasons. First, it saved you the hassle of finding a sound. Also, I wanted a short sound. Had you chosen a longer sound such as Beam Scan, you might have noticed that there's enough time to roll over the button, roll off, and roll back on quickly, and the result will be a layering effect on the sound—which is not exactly pleasant. This can be fixed by changing the Properties panel's Sync setting to Start (as we did in Hour 10).



Not a subscriber?

Start A Free Trial

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