True Constant; Undefined Constant - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

true constant

A unique Boolean value that represents the opposite of
. When automatic data typing
false
converts
to a number, it becomes 1; when it converts
to a string, it becomes
true
true
.
"true"
Availability: ActionScript 1.0; Flash Lite 1.1
Example
The following example shows the use of
in an
statement:
true
if
var shouldExecute:Boolean;
// ...
// code that sets shouldExecute to either true or false goes here
// shouldExecute is set to true for this example:
shouldExecute = true;
if (shouldExecute == true) {
trace("your statements here");
}
// true is also implied, so the if statement could also be written:
// if (shouldExecute) {
// trace("your statements here");
// }
The following example shows how automatic data typing converts
to the number 1:
true
var myNum:Number;
myNum = 1 + true;
trace(myNum); // output: 2
See also
,
false constant
Boolean

undefined constant

A special value, usually used to indicate that a variable has not yet been assigned a value. A
reference to an undefined value returns the special value
. The ActionScript code
undefined
returns the string
. The only value of type
is
typeof(undefined)
"undefined"
undefined
.
undefined
In files published for Flash Player 6 or earlier, the value of
is "" (an
String(undefined)
empty string). In files published for Flash Player 7 or later, the value of
String(undefined)
is
(
is converted to a string).
"undefined"
undefined
30
ActionScript language elements

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Table of Contents