1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Flash Animation 9: Adding Interactivity with Buttons


1 of 10

Adding Interactive Options
Flash Animation 9: Adding Interactivity with Buttons
In this iteration, we're just going to learn how to create a simple button that doesn't really do anything other than demonstrate a mouse-over effect, just for the sake of learning the steps. We'll also touch on action-scripting for the first time.

So far we've just been covering simple animation to tell a story; it required no input from the viewer other than to watch and listen. Now we're going to add user interactivity to our animation, by giving the viewer options to choose from that determine what happens next.

To start with, you'll need to extend your animation by one frame. I prefer to do this by copying and pasting my last keyframe on each layer, just to ensure that anything that I do on this last frame doesn't affect any tweens or other actions that I've already completed. Now, on a new layer, on your last frame only, just set up a simple option; depending on the story of your current animation, it can be a yes/no question, or any other option, as long as it leads to a result of two or more different animations depending on the choice (for the following lessons). Mine's a little cheesy--Lex has two lucky shirts that he wears for races, and wants to know which one he should wear, the blue or the green. I just created a text box with the question displayed on one layer, and then on another layer used overlapping rectangles and fills to make a simple button with the option "Blue" on it. Only make one button; we don't need to make all of them from scratch.

©2014 About.com. All rights reserved.