| Foreword |
|
xi | |
| Preface |
|
xv | |
|
Part I. The ActionScript 2.0 Language |
|
|
|
ActionScript 2.0 Overview |
|
|
3 | (10) |
|
ActionScript 2.0 Features |
|
|
3 | (2) |
|
Features Introduced by Flash Player 7 |
|
|
5 | (1) |
|
Flash MX 2004 Version 2 Components |
|
|
6 | (2) |
|
ActionScript 1.0 and 2.0 in Flash Player 6 and 7 |
|
|
8 | (4) |
|
|
|
12 | (1) |
|
Object-Oriented ActionScript |
|
|
13 | (11) |
|
Procedural Programming and Object-Oriented Programming |
|
|
13 | (1) |
|
Key Object-Oriented Programming Concepts |
|
|
14 | (5) |
|
|
|
19 | (4) |
|
|
|
23 | (1) |
|
Datatypes and Type Checking |
|
|
24 | (35) |
|
|
|
30 | (1) |
|
|
|
31 | (5) |
|
|
|
36 | (4) |
|
|
|
40 | (1) |
|
Circumventing Type Checking |
|
|
41 | (4) |
|
|
|
45 | (9) |
|
Datatype Information for Built-in Classes |
|
|
54 | (1) |
|
ActionScript 2.0 Type Checking Gotchas |
|
|
55 | (3) |
|
Up Next: Creating Classes---Your Own Datatypes! |
|
|
58 | (1) |
|
|
|
59 | (65) |
|
|
|
59 | (5) |
|
Constructor Functions (Take 1) |
|
|
64 | (1) |
|
|
|
65 | (16) |
|
|
|
81 | (31) |
|
Constructor Functions (Take 2) |
|
|
112 | (7) |
|
|
|
119 | (4) |
|
Putting Theory into Practice |
|
|
123 | (1) |
|
Authoring an ActionScript 2.0 Class |
|
|
124 | (34) |
|
Class Authoring Quick Start |
|
|
124 | (1) |
|
Designing the ImageViewer Class |
|
|
125 | (4) |
|
ImageViewer Implementation (Take 1) |
|
|
129 | (5) |
|
Using ImageViewer in a Movie |
|
|
134 | (4) |
|
ImageViewer Implementation (Take 2) |
|
|
138 | (8) |
|
ImageViewer Implementation (Take 3) |
|
|
146 | (11) |
|
|
|
157 | (1) |
|
|
|
158 | (57) |
|
|
|
158 | (4) |
|
|
|
162 | (1) |
|
|
|
163 | (3) |
|
Overriding Methods and Properties |
|
|
166 | (27) |
|
Constructor Functions in Subclasses |
|
|
193 | (5) |
|
Subclassing Built-in Classes |
|
|
198 | (3) |
|
Augmenting Built-in Classes and Objects |
|
|
201 | (1) |
|
The Theory of Inheritance |
|
|
202 | (11) |
|
Abstract and Final Classes Not Supported |
|
|
213 | (1) |
|
|
|
214 | (1) |
|
Authoring an ActionScript 2.0 Subclass |
|
|
215 | (9) |
|
Extending ImageViewer's Capabilities |
|
|
215 | (1) |
|
The ImageViewerDeluxe Skeleton |
|
|
216 | (1) |
|
Adding setPosition() and setSize() Methods |
|
|
217 | (1) |
|
Autosizing the Image Viewer |
|
|
218 | (5) |
|
|
|
223 | (1) |
|
|
|
223 | (1) |
|
|
|
224 | (14) |
|
|
|
224 | (2) |
|
Interfaces and Multidatatype Classes |
|
|
226 | (1) |
|
|
|
227 | (5) |
|
Multiple Type Inheritance with Interfaces |
|
|
232 | (4) |
|
|
|
236 | (2) |
|
|
|
238 | (11) |
|
|
|
239 | (5) |
|
|
|
244 | (1) |
|
Package Access and the Classpath |
|
|
245 | (3) |
|
Simulating Packages in ActionScript 1.0 |
|
|
248 | (1) |
|
Just a Little More Theory |
|
|
248 | (1) |
|
|
|
249 | (34) |
|
The Exception-Handling Cycle |
|
|
250 | (5) |
|
Handling Multiple Types of Exceptions |
|
|
255 | (9) |
|
|
|
264 | (4) |
|
|
|
268 | (3) |
|
|
|
271 | (4) |
|
Control Flow Changes in try/catch/finally |
|
|
275 | (2) |
|
Limitations of Exception Handling in ActionScript 2.0 |
|
|
277 | (3) |
|
|
|
280 | (3) |
|
Part II. Application Development |
|
|
|
An OOP Application Framework |
|
|
283 | (8) |
|
The Basic Directory Structure |
|
|
284 | (1) |
|
The Flash Document (.fla file) |
|
|
284 | (1) |
|
|
|
285 | (2) |
|
|
|
287 | (2) |
|
The Exported Flash Movie (.swf file) |
|
|
289 | (1) |
|
Projects in Flash MX Professional 2004 |
|
|
290 | (1) |
|
|
|
290 | (1) |
|
Using Components with ActionScript 2.0 |
|
|
291 | (25) |
|
Currency Converter Application Overview |
|
|
291 | (1) |
|
Preparing the Flash Document |
|
|
292 | (3) |
|
The CurrencyConverter Class |
|
|
295 | (13) |
|
Handling Component Events |
|
|
308 | (7) |
|
|
|
315 | (1) |
|
|
|
316 | (16) |
|
The Duality of MovieClip Subclasses |
|
|
317 | (1) |
|
Avatar: A MovieClip Subclass Example |
|
|
318 | (8) |
|
Avatar: The Composition Version |
|
|
326 | (1) |
|
Issues with Nested Assets |
|
|
327 | (3) |
|
A Note on MovieClip Sub-subclasses |
|
|
330 | (1) |
|
|
|
331 | (1) |
|
Distributing Class Libraries |
|
|
332 | (17) |
|
Sharing Class Source Files |
|
|
332 | (6) |
|
Sharing Classes Without Sharing Source Files |
|
|
338 | (8) |
|
Solving Real OOP Problems |
|
|
346 | (3) |
|
Part III. Design Pattern Examples in ActionScript 2.0 |
|
|
|
Introduction to Design Patterns |
|
|
349 | (3) |
|
|
|
351 | (1) |
|
The Observer Design Pattern |
|
|
352 | (29) |
|
Implementing Observer in ActionScript 2.0 |
|
|
354 | (6) |
|
Logger: A Complete Observer Example |
|
|
360 | (18) |
|
Memory Management Issues with Observer |
|
|
378 | (2) |
|
|
|
380 | (1) |
|
The Singleton Design Pattern |
|
|
381 | (5) |
|
Implementing Singleton in ActionScript 2.0 |
|
|
381 | (2) |
|
The Singleton Pattern in the Logger Class |
|
|
383 | (1) |
|
Singleton Versus Class Methods and Class Properties |
|
|
384 | (1) |
|
A Warning Against Singletons as Globals |
|
|
385 | (1) |
|
|
|
385 | (1) |
|
The Model-View-Controller Design Pattern |
|
|
386 | (37) |
|
The General Architecture of MVC |
|
|
388 | (4) |
|
A Generalized MVC Implementation |
|
|
392 | (6) |
|
|
|
398 | (23) |
|
|
|
421 | (2) |
|
The Delegation Event Model |
|
|
423 | (58) |
|
Structure and Participants |
|
|
423 | (4) |
|
|
|
427 | (1) |
|
|
|
427 | (5) |
|
NightSky: A Delegation Event Model Example |
|
|
432 | (10) |
|
Other Event Architectures in ActionScript |
|
|
442 | (1) |
|
From Some Place to Some OtherPlace |
|
|
443 | (4) |
|
|
|
|
A. ActionScript 2.0 Language Quick Reference |
|
|
447 | (31) |
|
B. Differences from ECMAScript Edition 4 |
|
|
478 | (3) |
| Index |
|
481 | |