A-C > Boolean (object)
Boolean (object)The Boolean object is a simple wrapper object with the same functionality as the standard JavaScript Boolean object. Use the Boolean object to retrieve the primitive data type or string representation of Boolean object.
Method summary for the Boolean object
Method | Description |
---|---|
|
Returns the string representation |
|
Returns the primitive value type of the specified Boolean object. |
Constructor for the Boolean object
Syntax
new Boolean();
new Boolean(
x
);
Arguments
x
A number, string, Boolean, object, movie clip, or other expression. This argument is optional.
Description
Constructor; creates an instance of the Boolean object. If you omit the x
argument, the Boolean object is initialized with a value of false
. If you specify x
, the method evaluates the argument and returns the result as a Boolean value according to the following casting rules:
![]() |
If x is a number, the function returns true if x does not equal 0, or false if x is any other number. |
![]() |
If x is a Boolean, the function returns x . |
![]() |
If x is an object or movie clip, the function returns true if x does not equal null ; otherwise, the function returns false . |
![]() |
If x is a string, the function returns true if Number( x ) does not equal 0; otherwise, the function returns false . |
Note: To maintain compatibility with Flash 4, the handling of strings by the Boolean object is not ECMA-262 standard.
Player
Flash 5 or later.