Add sound to a button
In this Flash tutorial you will learn how to add sound to a button. This tutorial is useful if you want to create a mouse over sound effect that can be used in flash websites, applications and games. For this tutorial i have used a sound effect of a cow which is avaiable at: www.findsounds.com
Adding sound to a button
Step 1
Create a new flash document.
Import your audio file into the library by selecting File > Import > Import to library then select your audio file and click ok.
Step 2
Create your button on the stage. I made a basic rectangle shape with a green colour and black stroke,but you can make whatever kind of button you wish.
Using the selection tool (v) select your button.
Convert it into a symbol by pressing F8 then give your symbol an appropriate name and check the “button” button then click ok.
Step 3
Double click on your sound button and your timeline should look like below:
Now select the over state and create a new key frame by selecting F6.
Step 4
With the over state selected go to the bottom of screen and choose your audio file from the drop down menu.
Step 5
Test your movie Ctrl + enter and move your mouse over the button.
You should now have a button with sound. Feel free to contact me for any questions or comments and remember to subscribe.



8 comments:
Thanks for the great tutorial! I have a question.. How do you make sure the sound doesn't overlap? Like in the instance where the cursor goes over the button more than once - the sound turns into a real mess. I'd like o create a sound button that plays the sound once when you put your cursor over it and stops playing it when your cursor leaves the button. Makes sense? I've researched this a LOT and cannot figure it out. Thanks!
Sara
@Sara.s
You can try disabling the button with the 'enabled' property.
thanks for the easy to follow tutorial. I managed to create the button in less than a minute!!!
brilliant. got it done in two minutes
This is brilliant thanks.
Would you mind please explaining where I can find the 'enabled' property? Sorry - I only know basic Flash.
I need the sound to stop when the button is no longer being rolled over.
@Anonymous
You don’t need to find the enabled property. Buttons and movie clips have properties you can change.
For Actionscript 2.0 use the following:
yourButtonInstanceName._enabled = false;
And for Actionscript 3.0 use the following:
yourButtonInstanceName.enabled = false;
Here are some links with information on the enabled property.
1.http://bit.ly/5ydXlL
2.http://bit.ly/4svwcs
Thank you!!!!!
Now i can make a soundboard!!! ;D
@LHamels
I already have a soundboard tutorial for AS2 and AS3.
Post a Comment