
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
62
|
Chapter 4: Classes
Further, the term instance member refers to either an instance property or an instance
method (covered later), while the term class member refers to either a class property
or a class method (also covered later). The terms static member, static property, and
static method are sometimes used as synonyms for the terms class member, class
property, and class method. We’ll learn much more about instance and class mem-
bers throughout this chapter.
Class Attributes
Class definitions can be modified with one or both of two attributes: dynamic and
intrinsic. Attributes dictate how a class and its instances can be used in a program.
Attributes must be listed before the keyword
class in a class definition. For exam-
ple, to add the dynamic attribute to the Box class, we’d use:
dynamic class Box {
}
ActionScript 2.0 does not support ECMAScript 4’s final attribute (which prevents a
class from being subclassed), nor does it support a Java-style abstract modifier
(which prevents instances of a class from being created). For one way to simulate an
abstract class, see “Constructor Functions (Take 2),” later in this chapter.
The dynamic attribute
By default, a class’s members must be defined exclusively within the class statement.
Any attempt to add a property or method to an individual ...