MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 614

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

set variable
Availability
Flash Player 4.
Usage
set(variable, expression)
Parameters
An identifier to hold the value of the
variable
A value assigned to the variable.
expression
Returns
Nothing.
Description
Statement; assigns a value to a variable. A variable is a container that holds data. The container
itself 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
Variables can hold any data type (for example, String, Number, Boolean, Object, or MovieClip).
The Timeline of each SWF file and movie clip has its own set of variables, and each variable has
its own value independent of variables on other Timelines.
Strict data typing is not supported inside a
variable to a value whose data type is different from the data type associated with the variable in a
class file, no compiler error is thrown.
Example
This example sets a variable called
movie clip in order to reset the ship to its starting location later in the SWF file.
ship
on(release) {
set("orig_x_pos", getProperty ("ship", _x ));
}
The previous code gives the same result as the following code:
on(release) {
orig_x_pos = ship._x;
}
See also
,
call()
var
614
Chapter 12: ActionScript Dictionary
expression
statement. If you use this statement to set a
set
_
, which stores the original x axis position of the
orig
x_pos
parameter.
or
.
true
false

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents