You want to use the properties and
methods of a built-in object, such as the
Math object, to perform a given operation.
Access the properties and methods of the built-in object directly,
Math.random( ) or
ActionScript includes several objects with methods and properties
that you can access directly from the class (there is no need to
construct an instance of the class). Methods and properties accessed
in this manner are often referred to as static
methods and properties. Static methods and properties are often
defined for classes that do not get instantiated. For example, the
objects define multiple static methods and properties. However, there
are also classes, from which objects are otherwise instantiated, that
include one or more static methods or properties. For example, the
String class is typically instantiated (meaning
you normally create string objects) but it also includes the static
String.fromCharCode( ). Likewise, the
Object class is typically instantiated but it
includes the static method
). In these cases, the static methods or properties are
associated with the class because they don’t pertain
to a specific instance of the class.
In any case, you can access static methods and properties by invoking them directly from the class using dot syntax. Here are two examples:
trace(Math.PI); trace(String.fromCharCode(108)); ...