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.

list_txt.htmlText += "Track 2";<br />

When you click a link, the MP3 sound file streams in Flash Player.<br />

See also<br />

htmlText (TextField.htmlText property)<br />

Boolean function<br />

Boolean(expression:Object) : Boolean<br />

Converts the expression parameter to a Boolean value <strong>and</strong> returns a value as described in the<br />

following list:<br />

■ If expression is a Boolean value, the return value is expression.<br />

■ If expression is a number, the return value is true if the number is not 0; otherwise the<br />

return value is false.<br />

If expression is a string, the return value is as follows:<br />

■ In files published for Flash Player 6 <strong>and</strong> earlier, the string is first converted to a number.<br />

The value is true if the number is not 0, otherwise the return value is false.<br />

■ In files published for Flash Player 7 <strong>and</strong> later, the result is true if the string has a length<br />

greater than 0; the value is false for an empty string.<br />

If expression is a string, the result is true if the string has a length greater than 0; the value<br />

is false for an empty string.<br />

■ If expression is undefined or NaN (not a number), the return value is false.<br />

■ If expression is a movie clip or an object, the return value is true.<br />

Unlike the Boolean class constructor, the Boolean() function does not use the keyword new.<br />

Moreover, the Boolean class constructor initializes a Boolean object to false if no parameter<br />

is specified, while the Boolean() function returns undefined if no parameter is specified.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 5 - Behavior changed in Flash Player 7.<br />

Parameters<br />

expression:Object - An expression to convert to a Boolean value.<br />

Returns<br />

Boolean - A Boolean value.<br />

Example<br />

trace(Boolean(-1)); // true<br />

Global Functions 51

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

Saved successfully!

Ooh no, something went wrong!