Number class
371
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.
To call the Number class methods, you must first use the constructor to create an instance of the
Number class. The properties of the Number class, however, are static, which means you do not
need an object to use them, so you do not need to use the constructor.
The following example calls the
toString()
method of the Number class, which returns the
string
1234
:
var myNumber:Number = new Number(1234);
myNumber.toString();
The following example assigns the value of the
MIN_VALUE
property to a variable declared without
the use of the constructor:
var smallest:Number = Number.MIN_VALUE;
Method summary for the Number class
Property summary for the Number class
The properties in the following table are constants:
Method
Description
Number.toString()
Returns the string representation of a Number object.
Number.valueOf()
Returns the primitive value of a Number object.
Property
Description
Number.MAX_VALUE
The largest representable number (double-precision IEEE-754). This
number is approximately 1.79E+308.
Number.MIN_VALUE
The smallest representable number (double-precision IEEE-754).
This number is approximately 5e-324.
Number.NaN
The value for Not a Number (
NaN
).
Number.NEGATIVE_INFINITY
The value for negative infinity.
Number.POSITIVE_INFINITY
The value for positive infinity. This value is the same as the global
variable
Infinity
.
CHAPTER 6
ActionScript Core Classes
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
Page 1: ...Flex ActionScript Language Reference...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Page 135: ...case 135 See also break default strict equality switch...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Page 808: ...808 Chapter 7 ActionScript for Flash...
Page 810: ...810 Appendix A Deprecated Flash 4 operators...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Page 822: ...822 Index...