MACROMEDIA FLASHLITE2 ACTIONSCRIPT-LANGUAGE Reference page 31

Actionscript language reference
Table of Contents

Advertisement

In files published for Flash Player 6 or earlier, the value of
published for Flash Player 7 or later, the value of
The value
undefined
compared with the equality (
are compared with the strict equality (
undefined
Availability: ActionScript 1.0; Flash Lite 1.1
Example
In the following example, the variable
.
undefined
In the first section of code, the equality operator (
, and the appropriate result is sent to the Output panel. In the first section of code,
undefined
the equality operator (
appropriate result is sent to the log file.
In the second section of code, the equality (
.
undefined
// x has not been declared
trace("The value of x is "+x);
if (x == undefined) {
trace("x is undefined");
} else {
trace("x is not undefined");
}
trace("typeof (x) is "+typeof (x));
if (null == undefined) {
trace("null and undefined are equal");
} else {
trace("null and undefined are not equal");
}
The following result is displayed in the Output panel.
The value of x is undefined
x is undefined
typeof (x) is undefined
null and undefined are equal
is similar to the special value
) operator, they compare as equal. However, when
==
has not been declared and therefore has the value
x
) compares the value of
==
Number(undefined)
Number(undefined)
. When
null
) operator, they compare as not equal.
===
) compares the value of
==
to the value
x
undefined
) operator compares the values
==
is
. In files
0
is
.
NaN
and
null
undefined
null
to the value
x
, and the
and
null
Constants
are
and
31

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash lite 2

Table of Contents