Number Class - MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

null
Availability
Flash Player 5.
Usage
null
Parameters
None.
Returns
Nothing.
Description
Constant; a special value that can be assigned to variables, or returned by a function if no data
was provided. You can use
data type.
Example
In a numeric context,
statement, a binary tree node has no left child, so the field for its left child could be set to
if (tree.left == null) {
tree.left = new TreeNode();
}

Number class

Availability
Flash Player 5 (became a native object in Flash Player 6, which improved
performance significantly).
Description
The Number class is a simple wrapper object for the Number data type. You can manipulate
primitive numeric values by using the methods and properties associated with the Number class.
This class is identical to the JavaScript Number class.
You must use a constructor when calling the methods of a Number object, but you do not need to
use the constructor when calling the properties of a Number object. The following examples
specify the syntax for calling the methods and properties of a Number object.
The following example calls the
string "1234".
myNumber = new Number(1234);
myNumber.toString();
This example calls the
smallest = Number.MIN_VALUE
to represent values that are missing or do not have a defined
null
evaluates to 0. Equality tests can be performed with
null
toString()
property (also called a constant) of a Number object:
MIN_VALUE
method of a Number object, which returns the
. In this
null
.
null
Number class
569

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Table of Contents