| introduction | action script | event handling | code snippets |

How to get started with ActionScript

Professional CS6. You can use ActionScript to add complex interactivity, playback control, and data display to your application. For example, you might want to animate a picture of a boy walking. By adding ActionScript, you could have the animated boy follow the pointer around the screen, stopping whenever he collides with a piece of animated furniture.

ActionScript is an object-oriented programming language. Object-oriented programming is a way to organize the code in a program, using code to define objects and then sending messages back and forth between those objects. You don’t have to be a programmer to take advantage of ActionScript (see “Using Script Assist mode” later in this guide). But the following concepts will help:

If you’ve worked with symbols in Flash, you’re already used to working with objects. Imagine you’ve defined a movie clip symbol—say a drawing of a rectangle—and you’ve placed a copy of it on the Stage. That movie clip symbol is also an object in ActionScript; it’s an instance of the MovieClip class. The main timeline of a Flash movie also belongs to the MovieClip class.

You can modify various characteristics of any movie clip. When a movie clip is selected, the Properties panel shows some of the characteristics you can change, such as its X coordinate or its width. Or you can make color adjustments such as changing the clip’s alpha (transparency). Other Flash tools let you make more changes, such as using the Free Transform tool to rotate the rectangle. Any way you can modify a movie clip symbol in the Flash authoring environment you can also do in ActionScript. In ActionScript, you use the methods of the MovieClip class to manipulate or change the properties of your movie clip.

For more about object-oriented programming, see rogramming ActionScript 3.0, “Object-oriented programming in ActionScript” (in Flash, select Help > Flash Help).