Students will learn to create mouseover events that trigger the playing of a sound.
- Students will complete the tutorial by having a rollover button that triggers a sound.
- Students will then apply the tutorial to add four more sounds to the interface.
Before you open Flash create a folder in your drive for this assignment. Save the supplied sound files into this folder. Sound Files You may also use your own sounds.
Setting the Stage
Open Flash. Create a Actionscript 3.0 document that is 500px wide and 100 px high.
Draw a rectangle that will become a button. The size should be 100 x 100 px and it should be placed at 0,0.
Convert the shape to a Button symbol by going to Modify/Convert to Symbol and choose Button.
Making the Button
Export for ActionScript
Base Class: flash.media.Sound
Also rename the instance btnlowKick in the Properties
Importing Sound to the Library
File/ Import to Library and choose lowKick.wav. It will appear in the Library Tab.
Double click in the space under AS linkages (by lowKick.wav) and type in lowKick1
Right Click on frame one and add the following code
Save your file in the same folder as the sounds. Go CTRL + ENTER to test. Your sound should play when your mouse rolls over.
Add four more buttons with four more sounds by repeating the steps to create the button and Importing the Sound. You will also need to add code. You may do so by declaring more variables and simply repeating the lower block of text, changing the name of the instance.
Post your “SoundBar” to your website when done.