= (assignment)
Availability
Flash Player 4.
In Flash 5 or later,
Flash 4,
is a numeric equality operator. Flash 4 files that are brought into the Flash 5 or later
=
authoring environment undergo a conversion process to maintain data type integrity.
Flash 4 file:
x = y
Converted Flash 5 or later file:
Number(x) == Number(y)
Usage
expression1 = expression2
Parameters
A variable, element of an array, or property of an object.
expression1
A value of any type.
expression2
Returns
The assigned value,
Description
Operator; assigns the value of
element, or property in
Assignment by value copies the actual value of
Assignment by value is used when a variable is assigned a number or string literal. Assignment by
reference stores a reference to
commonly used with the
a reference to that location in memory is assigned to a variable.
For more information, see "Operator precedence and associativity" in Using ActionScript in
Flash.
Example
The following example uses assignment by value to assign the value of 5 to the variable
var x:Number = 5;
The following example uses assignment by value to assign the value
var x:String;
x = "hello";
78
Chapter 2: ActionScript Language Reference
is an assignment operator, and the
=
.
expression2
expression2
. Assignment can be either by value or by reference.
expression1
expression2
operator. Use of the
new
operator is used to evaluate equality. In
==
(the parameter on the right) to the variable, array
and stores it in
expression2
in
. Assignment by reference is
expression1
operator creates an object in memory and
new
expression1
.
x
to the variable
"hello"
.
:
x
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?