CHAPTER 7
Using the Built-In Classes
In addition to the ActionScript core language elements and constructs (
and
loops,
for
while
for example) and primitive data types (numbers, strings, and arrays) described earlier in this
manual (see
"ActionScript Basics" on page
23), ActionScript also provides several built-in classes
(complex data types). These classes provide a variety of scripting features and functionality.
Some of these classes are based on the ECMAScript specification and are called core ActionScript
classes. Examples of core classes are the Array, Boolean, Date, and Math classes. For a complete
list, see
"Core classes" on page
199.
The rest of the built-in ActionScript classes are specific to Macromedia Flash and the Flash Player
object model. Examples of these classes are the Camera, MovieClip, and LoadVars classes. For a
complete list, see
"Classes specific to Flash Player" on page
200.
To understand the distinction between core ActionScript classes and those specific to Flash,
consider the distinction between core and client-side JavaScript: The client-side JavaScript classes
provide control over the client environment (the web browser and web page content), and the
classes specific to Flash provide runtime control over the appearance and behavior of a Flash
application.
This chapter introduces the built-in ActionScript classes, describes common tasks you can
perform with these classes, and provides code examples. For an overview of these classes, see
"Overview of built-in classes" on page
199. For an overview of working with classes and objects in
object-oriented programming, see
"About classes and instances" on page
197.
About classes and instances
In object-oriented programming, a class defines a category of object. A class describes the
properties (data) and behavior (methods) for an object, much like an architectural blueprint
describes the characteristics of a building. To use the properties and methods defined by a class,
you generally first create an instance of that class (except for classes that have static members). The
relationship between an instance and its class is similar to the relationship between a house and its
architectural blueprints.
197
Need help?
Do you have a question about the FLASH MX 2004-USING ACTIONSCRIPT IN FLASH and is the answer not in the manual?
Questions and answers