03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Boolean constructor<br />

public Boolean([value:Object])<br />

Creates a Boolean object. If you omit the value parameter, the Boolean object is initialized<br />

with a value of false. If you specify a value for the value parameter, the method evaluates it<br />

<strong>and</strong> returns the result as a Boolean value according to the rules in the global Boolean()<br />

function.<br />

Parameters<br />

value:Object [optional] - Any expression. The default value is false.<br />

Example<br />

The following code creates a new empty Boolean object called myBoolean:<br />

var myBoolean:Boolean = new Boolean();<br />

toString (Boolean.toString method)<br />

public toString() : String<br />

Returns the string representation ("true" or "false") of the Boolean object.<br />

Returns<br />

String - A string; "true" or "false".<br />

Example<br />

This example creates a variable of type Boolean <strong>and</strong> uses toString() to convert the value to a<br />

string for use in the trace statement:<br />

var myBool:Boolean = true;<br />

trace("The value of the Boolean myBool is: " + myBool.toString());<br />

myBool = false;<br />

trace("The value of the Boolean myBool is: " + myBool.toString());<br />

valueOf (Boolean.valueOf method)<br />

public valueOf() : Boolean<br />

Returns true if the primitive value type of the specified Boolean object is true; false<br />

otherwise.<br />

Returns<br />

Boolean - A Boolean value.<br />

252 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!