set()
Availability
Flash Lite 1.0.
Usage
set(variable, expression)
Operands
An identifier to hold the value of the
variable
A value assigned to the variable.
expression
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
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
position of the
ship
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;
}
38
Flash Lite Global Functions
movie clip to reset the ship to its starting location later in the SWF file:
parameter.
expression
_
, which stores the original x axis
orig
x_pos
true
Need help?
Do you have a question about the FLASH 8-FLASH LITE 1.X ACTIONSCRIPT LANGUAGE and is the answer not in the manual?