Chapter 12. Introduction to ActionScript 3
When your Flash document is on your computer, you’re in control. You can make it do whatever you want, whenever you want. But eventually, your creation has to strike out on its own. You won’t be there to tell your animation what to do when someone clicks a button or to remind it to turn off the sound after the first three times through. You need to provide instructions to make your animation perform automatically—that is, automate it.
To automate your animation or make it interactive, you use ActionScript—Flash’s built-in programming language—to act on, or script, the different parts of your animation. For example, you can instruct your animation to load a web page when someone clicks a button you’ve added, to start playing an audio clip at the beginning of a certain scene, to play your animation in reverse, to loop certain sections of your animation, and so on.
Flash calls the chunks of ActionScript code you attach to your animation actions, which is a great reminder that ActionScript exists to help your audience interact with your animation.
The first part of this chapter explains how ActionScript has grown up from a simple macro language for animations into a full-blown programming language. After that, the chapter introduces you to some of ActionScript’s basic concepts, with examples each step of the way. Follow the examples and try some experiments of your own. Go ahead, you won’t break anything. You’re on your way to a whole new level ...
Get Flash CS5.5: The Missing Manual now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.