
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Designing the ImageViewer Class
|
125
3. Use the class as desired throughout the .fla file, but after the export frame speci-
fied in Step 2 (if any).
4. Export a .swf file using one of the following: File
➝ Publish, Control ➝ Test
Movie, or File
➝ Export ➝ Export Movie.
The preceding steps apply nicely to small projects in which code reuse and distribu-
tion are not factors. For information on managing a group of classes across many
applications, see Chapters 9 and 14.
Now let’s get started building the ImageViewer class.
Designing the ImageViewer Class
Once you get comfortable with the syntax of your first object-oriented language,
you’ll inevitably realize that the challenge of OOP isn’t mastering the syntax, it’s
designing each application’s architecture. As an OOP programmer, you’ll face design
decisions daily: which classes will make up the application? How will those classes
interrelate? What public methods and properties will they expose? What methods
and properties must be kept internal? What will all these classes, methods, and prop-
erties be named?
Luckily, you won’t have to face these questions alone. For years, the OOP community
has been cataloging so-called design patterns, which describe common solutions to gen-
eralized, recurring design problems. We’ll see how to apply design ...