Introduction to ActionScript Tutorial > Initialize the movie |
![]() ![]() ![]() |
Initialize the movie
All movies have an initial state. This shows how a movie looks before it runs and anyone interacts with it. Sometimes you must set variables and movie clip properties to establish this first state. For example, in the puzzle.fla file, certain dialog boxes and pattern guides must be hidden in the initial state.
Each movie clip in a Flash movie has a set of qualities, or properties, that you can manipulate with ActionScript. Each of those properties is identified by a name preceded by an underscore (_
) character. For example, each movie clip has an _xscale
property, a _yscale
property, and a _rotation
property, among others.
ActionScript uses variables to store information. For example, the variable myName
might hold the value "Jody Singer"
.
You can learn more about variables in the section Save and retrieve information.
You initialize properties and variables in the first frame of a movie. You can assign a frame action in the Timeline, or attach an object action to a movie clip. In the puzzle movie, the properties of the pattern guide and dialog box movie clips are initialized in the first frame of the main Timeline.
![]() ![]() ![]() |