User Guide

62 ActionScript Language and Syntax
Methods created in this way, however, do not have access to any private properties or methods
of the Protean class. Moreover, even references to public properties or methods of the
Protean class must be qualified with either the this keyword or the class name. The
following example shows the
traceProtean() method attempting to access the private and
public variables of the
Protean class.
myProtean.traceProtean = function ()
{
trace(myProtean.privateGreeting); // undefined
trace(myProtean.publicGreeting); // hello
};
myProtean.traceProtean();
Data type descriptions
The primitive data types include Boolean, int, Null, Number, String, uint, and void. The
ActionScript core classes also define the following complex data types: Object, Array, Date,
Error, Function, RegExp, XML, and XMLList.
Boolean data type
The Boolean data type comprises two values: true and false. No other values are valid for
variables of Boolean type. The default value of a Boolean variable that has been declared but
not initialized is
false.
int data type
The int data type is stored internally as a 32-bit integer and comprises the set of integers from
-2,147,483,648 (-2
31
) to 2,147,483,647 (2
31
- 1), inclusive. Previous versions of ActionScript
offered only the Number data type, which was used for both integers and floating point
numbers. In ActionScript 3.0, you now have access to low-level machine types for 32-bit
signed and unsigned integers. If your variable will not use floating point numbers, using the
int data type instead of the Number data type should be faster and more efficient.
For integer values outside the range of the minimum and maximum int values, use the
Number data type, which can handle values between positive and negative
9,007,199,254,740,992 (53-bit integer values). The default value for variables that are of the
data type int is 0.