O'Reilly logo

ActionScript 2.0 Language Reference for Macromedia® Flash® 8 by Shimul Rahim, Robert L. Dixon, Jen deHaan, Francis Cheng

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Number

Object
  |
  +-Number

public class Number
extends Object

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.

The properties of the Number class 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 = ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required