
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Further ActionScript Concepts
|
21
movie clip instance that is repositioned on the Stage repetitively. Using ActionScript,
we can alter an instance’s location, size, current frame, rotation, and so forth, during
the playback of our movie.
If you’re unfamiliar with movie clips and instances, see “Working with Movie Clips
and Buttons” under Help
➝ Using Flash before continuing with the rest of this book.
The Event-Based Execution Model
The final topic in our overview of ActionScript fundamentals is the execution model,
which dictates when the code in your movie runs (is executed). You may have code
attached to various frames, buttons, and movie clips throughout your movie, but
when does it all actually run? To answer that question, let’s take a short stroll down
computing history’s memory lane.
In the early days of computing, a program’s instructions were executed sequentially,
in the order that they appeared, starting with the first line and ending with the last
line. The program was meant to perform some action and then stop. That kind of
linear program, called a batch program, doesn’t handle the interactivity required of
an event-based programming environment like Flash.
Event-based programs don’t run in a linear fashion. They run continuously (in an
event loop), waiting for things (events ...