
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
274
Chapter 12
CHAPTER 12
Objects and Classes
This chapter covers object-oriented programming (OOP), which is new territory for
many readers. We’ll cover OOP methodology and terminology, using applied exam-
ples to make it all concrete. For the benefit of both experienced programmers and
new programmers who appreciate a broad perspective, we’ll compare ActionScript’s
OOP practices with those of Java and other languages. Experienced object-oriented
programmers who simply want an overview of ActionScript’s OOP syntax may want
to skip directly to the “OOP Quick Reference” at the end of this chapter.
If you’re new to object-oriented programming, you may have heard that OOP is
some big mystery or that it’s difficult to understand. Quite to the contrary, the con-
cepts are highly intuitive, and the OOP process is much easier than you may have
been led to believe. At its heart, OOP simply means that you treat portions of your
program as self-contained modules called “objects.” By “self-contained,” we don’t
mean that objects are isolated, but rather that they can be independent of each other,
and that you can use an object without worrying about its internal details. OOP con-
cepts are easy to grasp once you realize that everything you deal with in the real
world is a self-contained object. Your ...