User Guide

Constants 37
Example
The following example shows how
newline displays output from the trace() statement on
multiple lines.
var myName:String = "Lisa", myAge:Number = 30;
trace(myName+myAge);
trace("-----");
trace(myName+newline+myAge);
// output:
Lisa30
-----
Lisa
30
See also
trace function
null constant
A special value that can be assigned to variables or returned by a function if no data was
provided. You can use
null to represent values that are missing or that do not have a defined
data type.
Availability: ActionScript 1.0; Flash Player 5
Example
The following example checks the first six values of an indexed array and outputs a message if
no value is set (if the value ==
null):
var testArray:Array = new Array();
testArray[0] = "fee";
testArray[1] = "fi";
testArray[4] = "foo";
for (i = 0; i < 6; i++) {
if (testArray[i] == null) {
trace("testArray[" + i + "] == null");
}
}
The output is the following:
testArray[2] == null
testArray[3] == null
testArray[5] == null