User Guide

64 ActionScript Language and Syntax
When you store integer values with the Number data type, only the 52 bits of the significand
are used. The Number data type uses these 52 bits and a special hidden bit to represent
integers from -9,007,199,254,740,992 (-2
53
) to 9,007,199,254,740,992 (2
53
).
Flash Player uses the
NaN value not only as the default value for variables of type Number, but
also as the result of any operation that should return a number but does not. For example, if
you attempt to calculate the square root of a negative number, the result will be
NaN. Other
special Number values include positive infinity and negative infinity
.
.
String data type
The String data type represents a sequence of 16-bit characters. Strings are stored internally as
Unicode characters, using the UTF-16 format. Strings are immutable values, just as they are
in the Java programming language. An operation on a String value returns a new instance of
the string. The default value for a variable declared with the String data type is
null. The
value
null is not the same as the empty string (""), even though they both represent the
absence of any characters.
uint data type
The uint data type is stored internally as a 32-bit unsigned integer and comprises the set of
integers from 0 to 4,294,967,295 (2
32
-1), inclusive. Use the uint data type for special
circumstances that call for non-negative integers. For example, you must use the uint data
type to represent pixel color values because the int data type has an internal sign bit that is not
appropriate for handling color values. For integer values larger than the maximum uint value,
use the Number data type, which can handle 53-bit integer values. The default value for
variables that are of data type uint is 0.
void data type
The void data type contains only one value, undefined. In previous versions of ActionScript,
undefined was the default value for instances of the Object class. In ActionScript 3.0, the
default value for Object instances is
null. If you attempt to assign the value undefined to an
instance of the Object class, Flash Player will convert the value to
null. You can only assign a
value of
undefined to variables that are untyped. Untyped variables are variables that either
lack any type annotation, or use the asterisk (
*) symbol for type annotation. You can use void
only as a return type annotation.
NOTE
The result of division by 0 is only NaN if the divisor is also 0. Division by 0 produces
infinity when the dividend is positive or -infinity when the dividend is negative.