User Guide

270 ActionScript classes
Example
The following code creates a new empty Boolean object called
myBoolean:
var myBoolean:Boolean = new Boolean();
toString (Boolean.toString method)
public toString() : String
Returns the string representation ("true" or "false") of the Boolean object.
Availability: ActionScript 1.0; Flash Lite 2.0
Returns
String - A string; "true" or "false".
Example
This example creates a variable of type Boolean and uses
toString() to convert the value to a
string for use in the trace statement:
var myBool:Boolean = true;
trace("The value of the Boolean myBool is: " + myBool.toString());
myBool = false;
trace("The value of the Boolean myBool is: " + myBool.toString());
valueOf (Boolean.valueOf method)
public valueOf() : Boolean
Returns true if the primitive value type of the specified Boolean object is true; false
otherwise.
Availability: ActionScript 1.0; Flash Lite 2.0
Returns
Boolean - A Boolean value.
Example
The following example shows how this method works, and also shows that the primitive value
type of a new Boolean object is
false:
var x:Boolean = new Boolean();
trace(x.valueOf()); // false
x = (6==3+3);
trace(x.valueOf()); // true