User Guide

Table Of Contents
38 Flash Lite Global Functions
set()
Availability
Flash Lite 1.0.
Usage
set(variable, expression)
Operands
variable An identifier to hold the value of the expression parameter.
expression A value assigned to the variable.
Description
Statement; assigns a value to a variable. A variable is a container that holds data. The
container is always the same, but the contents can change. By changing the value of a variable
as the SWF file plays, you can record and save information about what the user has done,
record values that change as the SWF file plays, or evaluate whether a condition is
true
or
false.
Variables can hold any data type (for example, String, Number, Boolean, or MovieClip). The
timeline of each SWF file and movie clip has its own set of variables, and each variable has its
own value that is independent of variables on other timelines.
Example
The following example sets a variable called orig_x_pos, which stores the original x axis
position of the
ship movie clip to reset the ship to its starting location later in the SWF file:
on(release) {
set("orig_x_pos", getProperty("ship", _x));
}
The preceding code gives the same result as the following code:
on(release) {
orig_x_pos = ship._x;
}