Operators
145
The following example creates a new movie clip within the
_root
scope. Then a text field is
created inside the movie clip called
container_mc
. The text field's
autoSize
property is set
to
true
and then populated with the current date.
this.createEmptyMovieClip("container_mc", this.getNextHighestDepth());
this.container_mc.createTextField("date_txt", this.getNextHighestDepth(),
0, 0, 100, 22);
this.container_mc.date_txt.autoSize = true;
this.container_mc.date_txt.text = new Date();
The dot (.) operator is used when targeting instances within the SWF file and when you need
to set properties and values for those instances.
== equality operator
expression1
==
expression2
Tests two expressions for equality. The result is
true
if the expressions are equal.
The definition of equal depends on the data type of the parameter:
■
Numbers and Boolean values are compared by value and are considered equal if they have
the same value.
■
String expressions are equal if they have the same number of characters and the characters
are identical.
■
Variables representing objects, arrays, and functions are compared by reference. Two such
variables are equal if they refer to the same object, array, or function. Two separate arrays
are never considered equal, even if they have the same number of elements.
When comparing by value, if
expression1
and
expression2
are different data types,
ActionScript will attempt to convert the data type of
expression2
to match that of
expression1
.
Availability:
ActionScript 1.0; Flash Lite 1.0
Operands
expression1 :
Object
- A number, string, Boolean value, variable, object, array, or
function.
expression2 :
Object
- A number, string, Boolean value, variable, object, array, or
function.
Returns
Boolean
- The Boolean result of the comparison.
Содержание Flash Lite 2
Страница 1: ...Flash Lite 2 x ActionScript Language Reference...
Страница 22: ...22 Contents...
Страница 244: ...244 ActionScript language elements...
Страница 760: ...760 ActionScript classes...