03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

null constant<br />

A special value that can be assigned to variables or returned by a function if no data was<br />

provided. You can use null to represent values that are missing or that do not have a defined<br />

data type.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 5<br />

Example<br />

The following example checks the first six values of an indexed array <strong>and</strong> outputs a message if<br />

no value is set (if the value == null):<br />

var testArray:Array = new Array();<br />

testArray[0] = "fee";<br />

testArray[1] = "fi";<br />

testArray[4] = "foo";<br />

for (i = 0; i < 6; i++) {<br />

if (testArray[i] == null) {<br />

trace("testArray[" + i + "] == null");<br />

}<br />

}<br />

The output is the following:<br />

testArray[2] == null<br />

testArray[3] == null<br />

testArray[5] == null<br />

true constant<br />

A unique Boolean value that represents the opposite of false. When automatic data typing<br />

converts true to a number, it becomes 1; when it converts true to a string, it becomes<br />

"true".<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 5<br />

Example<br />

The following example shows the use of true in an if statement:<br />

var shouldExecute:Boolean;<br />

// ...<br />

// code that sets shouldExecute to either true or false goes here<br />

// shouldExecute is set to true for this example:<br />

shouldExecute = true;<br />

40 <strong>ActionScript</strong> language elements

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!