This tutorial will show you exactly
how to add sounds to a button. Before we begin, if you don't know
how to create a button, please read the tutorial on creating
buttons first by clicking here.
The animation below will show you how
your final example will look like. Move the mouse over the button to
hear a sound and click on the button (circle) to hear another sound
as well.
Adding The Sound:
Since making you create the button
from scratch would be highly inefficient; for you are only interested
in adding sounds to a button. So, please download the button source
code. Don't worry, the sound will have to be added in by you with
the information contained below. Click here
to download the source.
Here's How:
Once you have opened the file
"be.fla" that you downloaded from my site, you should
simply see a circle just like my example above. To add the
sound, first right click on the Circle (button) and choose Edit.
Once you have done that, you should see the modified timeline to
accommodate the button. Insert a new layer above "Layer
1" and call it sound. See image below:
Now, what we want is to
have a sound playing when the user moves the mouse over the
button, and a sound should play when the user clicks on the
button. So, right click on the frame "Over" in the
Layer "sound" and Insert Keyframe. Insert a keyframe
in the frame marked Down as well. The keyframes should be
hollow.
The final step is to drag and drop a sound into the Over
keyframe and the Down keyframe in the "sound" layer.
So, click on Window > Common Libraries > Sounds. You
should see the Library window with all the sounds installed by
Flash. See image below on how to get to the Common Library:
All you have to do now is simply drag and drop.
Click on the Over keyframe and drag the sound "Brick
Drops" onto the animation. Then click on the Down keyframe
and drag the sound "Industrial Door Switch" onto the
animation. Now you should have a sound on each keyframe for Over
and Down. Your timeline should resemble that of mine below:
I hope the information helped.
If you have any questions or comments, please don't hesitate to post them on the
kirupa.com Forums. Just post your question and I, or our friendly
forum helpers, will help answer it.
The following is a list of related tutorial and help resources that you may find
useful: