
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
13
Chapter 2
CHAPTER 2
Object-Oriented ActionScript
Ironically, Flash users who are new to object-oriented programming (OOP) are often
familiar with many object-oriented concepts without knowing their formal names.
This chapter demystifies some of the terminology and brings newer programmers up
to speed on key OOP concepts. It also serves as a high-level overview of OOP in
ActionScript for experienced programmers who are making their first foray into
Flash development.
Procedural Programming and
Object-Oriented Programming
Traditional programming consists of various instructions grouped into procedures.
Procedures perform a specific task without any knowledge of or concern for the larger
program. For example, a procedure might perform a calculation and return the result.
In a procedural-style Flash program, repeated tasks are stored in functions and data is
stored in variables. The program runs by executing functions and changing variable
values, typically for the purpose of handling input and generating output. Procedural
programming is sensible for certain applications; however, as applications become
larger or more complex and the interactions between procedures (and the program-
mers who use them) become more numerous, procedural programs can become
unwieldy. They can be hard to maintain, ...