1. Computing

Flash Animation 16: Adding Sound to Buttons


1 of 7

Recap and Introduction
Flash Animation 16: Adding Sound to Buttons
To take our use of timed sounds further, we're going to set up buttons with sound effects that only play when we roll over the button, or when we click on it. Unlike in Lesson 15, we can't just set the sounds to play at a certain time, because we don't know when the user will roll their mouse over the button. It has to be triggered by the action; while you may be dreading a confusing lesson full of onmouseover and onclick coding, it's actually far simpler than you might think.

Since the last lesson I've moved my animation a touch further; I've animated a question and buttons entering the scene with sound effects and squash/stretch, using what we've learned in Lesson 15--after creating those buttons using what we learned in Lesson 9. I've also moved my bouncing snowball deeper into the plane of the picture, making it look like it was rolling by using the Rotation effect on a motion tween, and faking perspective by having it shrink a bit as it rolls. (You can see all of this in effect when you click on the final movie from the last step of this lesson.) Don't forget to insert a stop on your last frame.

©2014 About.com. All rights reserved.