Boolean
343
toString (Boolean.toString method)
public toString() : String
Returns the string representation (
"true"
or
"false"
) of the Boolean object.
Availability:
ActionScript 1.0; Flash Player 5
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 Player 5
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
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...