About the Authors |
|
xvii | |
About the Technical Reviewer |
|
xix | |
Layout Conventions |
|
xxi | |
|
Chapter 1 Getting Started with ActionScript 3.0 |
|
|
1 | (22) |
|
A Brief History of ActionScript |
|
|
1 | (1) |
|
The Rise of ActionScript 3.0 |
|
|
2 | (1) |
|
ActionScript and Object-Oriented Programming |
|
|
3 | (1) |
|
|
4 | (2) |
|
|
6 | (1) |
|
Adding ActionScript to Your Projects |
|
|
7 | (1) |
|
Placing Code on the Timeline |
|
|
7 | (2) |
|
Importing Code from an External File |
|
|
9 | (2) |
|
Specifying a Document Class |
|
|
11 | (1) |
|
Linking Library Assets to External Classes |
|
|
12 | (3) |
|
|
15 | (1) |
|
|
15 | (2) |
|
|
17 | (2) |
|
|
19 | (2) |
|
|
21 | (1) |
|
|
21 | (2) |
|
Chapter 2 ActionScript 3.0 Fundamentals |
|
|
23 | (44) |
|
Statements and Expressions |
|
|
24 | (1) |
|
|
25 | (1) |
|
Assigning a Value to a Variable |
|
|
25 | (1) |
|
Retrieving the Value of a Variable |
|
|
26 | (2) |
|
|
28 | (1) |
|
|
29 | (3) |
|
|
32 | (1) |
|
|
32 | (1) |
|
|
33 | (1) |
|
|
34 | (1) |
|
|
34 | (1) |
|
|
35 | (1) |
|
|
36 | (2) |
|
|
38 | (1) |
|
|
39 | (2) |
|
Understanding Type Checking |
|
|
41 | (1) |
|
|
41 | (1) |
|
Introducing the if Statement |
|
|
41 | (2) |
|
Forming Boolean Expressions |
|
|
43 | (1) |
|
|
44 | (1) |
|
|
45 | (2) |
|
|
47 | (1) |
|
|
47 | (3) |
|
|
50 | (1) |
|
|
50 | (1) |
|
|
51 | (1) |
|
|
52 | (1) |
|
|
52 | (1) |
|
|
53 | (1) |
|
|
53 | (1) |
|
|
54 | (1) |
|
Returning a Value from a Function |
|
|
55 | (2) |
|
Using Function Parameters |
|
|
57 | (1) |
|
Providing a Default Value for Function Parameters |
|
|
58 | (1) |
|
Allowing for Variable Parameters |
|
|
59 | (1) |
|
Passing Values and References |
|
|
60 | (2) |
|
|
62 | (1) |
|
|
63 | (1) |
|
|
64 | (1) |
|
Commenting for Documentation |
|
|
64 | (1) |
|
|
65 | (2) |
|
Chapter 3 Objects and Classes |
|
|
67 | (34) |
|
|
67 | (1) |
|
|
68 | (1) |
|
Creating Objects using the New Operator |
|
|
68 | (1) |
|
Accessing Properties and Calling Methods |
|
|
69 | (1) |
|
|
70 | (1) |
|
Casting Objects to a Type |
|
|
71 | (2) |
|
|
73 | (1) |
|
|
74 | (2) |
|
|
76 | (1) |
|
|
77 | (1) |
|
Creating Your First Class |
|
|
77 | (2) |
|
Choosing Suitable Names for your Classes |
|
|
79 | (1) |
|
|
79 | (2) |
|
|
81 | (3) |
|
Initializing Your Objects with a Constructor Method |
|
|
84 | (1) |
|
Controlling Access to Properties and Methods |
|
|
85 | (2) |
|
Adding Getter/Setter Methods |
|
|
87 | (3) |
|
Creating Read-Only Properties with Getter Methods |
|
|
90 | (1) |
|
Static Properties and Methods |
|
|
90 | (1) |
|
Taking Advantage of Inheritance |
|
|
91 | (4) |
|
Overriding Methods of the Base Class |
|
|
95 | (1) |
|
Using Packages to Group Your Classes |
|
|
96 | (1) |
|
|
97 | (2) |
|
Importing a Class from a Package |
|
|
99 | (1) |
|
Importing all Classes in a Given Package |
|
|
99 | (1) |
|
Resolving Naming Conflicts among Imported Classes |
|
|
99 | (1) |
|
Removing Dependency on Timeline Code |
|
|
100 | (1) |
|
|
100 | (1) |
|
Chapter 4 Working with the Display |
|
|
101 | (50) |
|
Introducing the Display List |
|
|
101 | (4) |
|
Working with Display Objects |
|
|
105 | (4) |
|
Manipulating Display Objects |
|
|
109 | (4) |
|
|
113 | (6) |
|
Creating new Display Objects |
|
|
119 | (1) |
|
Removing Display Objects from the Display List |
|
|
120 | (1) |
|
|
121 | (1) |
|
|
122 | (1) |
|
Applying a Filter to a Display Object |
|
|
123 | (4) |
|
Applying Filters in a Specific Order |
|
|
127 | (2) |
|
Making Changes to an Existing Filter |
|
|
129 | (3) |
|
Removing an Existing Filter |
|
|
132 | (2) |
|
Introducing the Advanced Filters |
|
|
134 | (1) |
|
|
135 | (1) |
|
|
135 | (1) |
|
Making a Movie Full Screen |
|
|
136 | (5) |
|
|
141 | (2) |
|
Loading from External Files |
|
|
143 | (1) |
|
Loading an External Asset |
|
|
143 | (2) |
|
Manipulating the Loaded Asset |
|
|
145 | (1) |
|
|
146 | (1) |
|
Copying Animation from the Timeline |
|
|
146 | (4) |
|
Animating other Properties |
|
|
150 | (1) |
|
|
150 | (1) |
|
Chapter 5 Creating Vector Graphics with the Drawing API |
|
|
151 | (34) |
|
Why we Need a Drawing API |
|
|
151 | (2) |
|
Understanding the Drawing API |
|
|
153 | (1) |
|
|
154 | (2) |
|
|
156 | (1) |
|
|
156 | (2) |
|
Controlling the Line Style |
|
|
158 | (2) |
|
|
160 | (1) |
|
Drawing and Filling Shapes |
|
|
161 | (1) |
|
|
161 | (3) |
|
|
164 | (1) |
|
Filling Shapes with a Solid Color |
|
|
165 | (2) |
|
Filling Shapes with Color Gradients |
|
|
167 | (5) |
|
|
172 | (2) |
|
Creating Gradient line Styles |
|
|
174 | (5) |
|
|
179 | (4) |
|
|
183 | (2) |
|
Chapter 6 User Interaction and More with Events |
|
|
185 | (38) |
|
|
185 | (1) |
|
|
186 | (1) |
|
Removing an Event Listener |
|
|
187 | (1) |
|
Naming Your Event Listener Methods |
|
|
188 | (1) |
|
Creating a Simple Drawing Application |
|
|
188 | (6) |
|
Using One Event Listener for Multiple Objects |
|
|
194 | (1) |
|
Using Events with the Display List |
|
|
195 | (1) |
|
Handling Single and Double Mouse Clicks |
|
|
195 | (4) |
|
Handling Mouse Hover States |
|
|
199 | (6) |
|
|
205 | (9) |
|
Preventing an Event's Default Action |
|
|
214 | (4) |
|
Capturing and Bubbling: The Event Flow |
|
|
218 | (1) |
|
Listening for Events in the Bubble Phase |
|
|
219 | (1) |
|
Listening for Events in the Capture Phase |
|
|
219 | (1) |
|
Stopping an Event from Propagating |
|
|
220 | (1) |
|
Removing Capture Phase Event Listeners |
|
|
221 | (1) |
|
|
221 | (2) |
|
Chapter 7 Working with Video |
|
|
223 | (48) |
|
|
223 | (1) |
|
|
223 | (1) |
|
Where ActionScript Comes in |
|
|
224 | (1) |
|
|
225 | (1) |
|
|
225 | (2) |
|
Using the Flash Video Encoder |
|
|
227 | (4) |
|
|
231 | (3) |
|
Using ActionScript to Play Videos |
|
|
234 | (1) |
|
Managing Connections with the NetConnectlon Class |
|
|
234 | (2) |
|
Loading and Controlling Video with the NetStream Class |
|
|
236 | (3) |
|
Creating Video Objects with the Video Class |
|
|
239 | (1) |
|
Creating Camera Objects with the Camera Class |
|
|
240 | (2) |
|
|
242 | (4) |
|
|
246 | (2) |
|
|
248 | (4) |
|
Controlling the Video Player |
|
|
252 | (5) |
|
Controlling the Video on the Stage |
|
|
257 | (13) |
|
|
270 | (1) |
|
|
270 | (1) |
|
|
271 | (48) |
|
Importing and Converting Sound Files |
|
|
271 | (1) |
|
|
271 | (3) |
|
|
274 | (1) |
|
Using ActionScript to Play Sound |
|
|
274 | (1) |
|
Accessing Sound Files with the Sound Class |
|
|
275 | (1) |
|
Controlling Sound Channels with the SoundChannel Class |
|
|
276 | (1) |
|
Doing Security Checks with the SoundLoaderContext Class |
|
|
276 | (1) |
|
Controlling Volume and Panning with the SoundTransform Class |
|
|
276 | (1) |
|
Controlling Sounds Globally with the SoundMixer Class |
|
|
277 | (1) |
|
Getting ID3 Data with the ID3Info Class |
|
|
277 | (1) |
|
Using a Microphone with the Microphone Class |
|
|
278 | (1) |
|
Understanding the Basics of a Sound Player Application |
|
|
279 | (10) |
|
|
289 | (1) |
|
|
290 | (5) |
|
|
295 | (4) |
|
Controlling the Audio as it Plays |
|
|
299 | (9) |
|
Controlling the Sound Volume and Panning |
|
|
308 | (10) |
|
Creating the Custom Event Class |
|
|
318 | (1) |
|
|
318 | (1) |
|
Chapter 9 Working with Components |
|
|
319 | (50) |
|
Just What are Components? |
|
|
319 | (1) |
|
Accessing Your Components |
|
|
320 | (2) |
|
Adjusting Component Parameters |
|
|
322 | (3) |
|
Benefits of Working with Components |
|
|
325 | (1) |
|
Exploring the Flash Component Framework |
|
|
326 | (1) |
|
|
326 | (2) |
|
|
328 | (2) |
|
|
330 | (2) |
|
|
332 | (7) |
|
|
339 | (1) |
|
|
339 | (2) |
|
|
341 | (5) |
|
|
346 | (1) |
|
|
346 | (3) |
|
Skinning using the Timeline |
|
|
349 | (4) |
|
|
353 | (4) |
|
Creating Components from Scratch |
|
|
357 | (1) |
|
|
357 | (2) |
|
Writing the Component Code |
|
|
359 | (6) |
|
Turning the Symbol into a Component |
|
|
365 | (1) |
|
|
366 | (2) |
|
Using Third-Party Components |
|
|
368 | (1) |
|
|
368 | (1) |
|
Chapter 10 Regular Expressions |
|
|
369 | (22) |
|
Why you Need Regular Expressions |
|
|
369 | (2) |
|
Introducing the RegExp Class |
|
|
371 | (1) |
|
Anatomy of a Regular Expression Pattern |
|
|
372 | (1) |
|
Introducing Metacharacters |
|
|
373 | (2) |
|
Providing Alternatives with Alternation |
|
|
375 | (1) |
|
Using Character Classes and Character Ranges |
|
|
375 | (1) |
|
Matching any Character using the Dot Metacharacter |
|
|
376 | (1) |
|
Matching a Number of Occurrences Using Quantifiers |
|
|
377 | (3) |
|
|
380 | (1) |
|
Accessing Matched Strings with Backreferences |
|
|
381 | (2) |
|
Understanding the E-Mail Regular Expression-Pattern |
|
|
383 | (1) |
|
Changing Regular Expression Behavior with-Modifiers |
|
|
384 | (1) |
|
Using the Case-Insensitive Modifier |
|
|
385 | (1) |
|
Using the Global Modifier |
|
|
385 | (2) |
|
Using the Multiline Modifier |
|
|
387 | (1) |
|
Using the Dotall Modifier |
|
|
387 | (1) |
|
Using the Extended Modifier |
|
|
387 | (1) |
|
Using Variables to Build a Regular Expression |
|
|
388 | (1) |
|
Useful Regular Expressions |
|
|
388 | (1) |
|
Regular Expression Resources |
|
|
389 | (1) |
|
|
389 | (2) |
|
|
391 | (16) |
|
Understanding XML and E4X |
|
|
391 | (1) |
|
|
392 | (1) |
|
|
393 | (1) |
|
|
393 | (1) |
|
|
394 | (1) |
|
|
394 | (2) |
|
Getting XML from a Remote Source |
|
|
396 | (1) |
|
|
396 | (1) |
|
|
396 | (1) |
|
Reading Elements in an XML Tree |
|
|
396 | (1) |
|
Reading an XML Element's Attributes |
|
|
397 | (1) |
|
|
398 | (1) |
|
Searching for an Attribute or Element at any Level |
|
|
399 | (2) |
|
|
401 | (1) |
|
|
402 | (1) |
|
Adding Elements to an XML Object |
|
|
402 | (3) |
|
Removing Elements and Attributes from an XML Object |
|
|
405 | (1) |
|
|
405 | (2) |
|
Chapter 12 Case Study: Creating a Dynamic Image Viewer |
|
|
407 | (34) |
|
An Overview of the Image Viewer |
|
|
408 | (1) |
|
|
409 | (5) |
|
Creating the Document Class |
|
|
414 | (5) |
|
|
419 | (2) |
|
|
421 | (1) |
|
|
422 | (2) |
|
|
424 | (1) |
|
|
425 | (3) |
|
|
428 | (1) |
|
|
429 | (1) |
|
Adding Graphic Enhancements |
|
|
430 | (1) |
|
|
430 | (1) |
|
Improving the Thumbnail Layout |
|
|
431 | (2) |
|
|
433 | (2) |
|
Creating an Animated Transition |
|
|
435 | (4) |
|
|
439 | (2) |
|
Chapter 13 Getting Started with Flex |
|
|
441 | (22) |
|
|
441 | (1) |
|
Understanding Rich Internet Applications |
|
|
441 | (1) |
|
|
442 | (1) |
|
|
442 | (1) |
|
|
442 | (1) |
|
|
442 | (1) |
|
The Flex Software Development Kit |
|
|
443 | (1) |
|
|
443 | (1) |
|
|
443 | (1) |
|
|
444 | (1) |
|
Getting Started with the Flex SDK |
|
|
444 | (1) |
|
|
444 | (4) |
|
Finding a Suitable Editor |
|
|
448 | (1) |
|
Building your first Flex Application |
|
|
448 | (4) |
|
Getting Started with Flash Builder |
|
|
452 | (1) |
|
Understanding the Flash Builder Interface |
|
|
452 | (1) |
|
Building your first Flash Builder Application |
|
|
453 | (8) |
|
|
461 | (2) |
|
Chapter 14 Flex by Example |
|
|
463 | (56) |
|
|
463 | (1) |
|
Gathering the Requirements |
|
|
464 | (1) |
|
Creating the Functional Specification |
|
|
465 | (1) |
|
|
466 | (1) |
|
Designing the Interaction |
|
|
466 | (1) |
|
Designing the Data and Logic |
|
|
467 | (1) |
|
|
467 | (2) |
|
|
469 | (1) |
|
|
469 | (1) |
|
Creating Basic Feed Integration |
|
|
470 | (1) |
|
Installing the XML Syndication Library |
|
|
471 | (4) |
|
Creating the Subscription Class |
|
|
475 | (1) |
|
Adding a New Class to Your Project |
|
|
475 | (2) |
|
Fleshing out the Subscription Class |
|
|
477 | (2) |
|
Testing the Subscription Class |
|
|
479 | (1) |
|
|
480 | (4) |
|
Allowing Subscription Instances to be used for Data Binding |
|
|
484 | (3) |
|
Creating the Subscriptions List |
|
|
487 | (3) |
|
Creating the Articles Data Grid |
|
|
490 | (3) |
|
Populating the Article Panel |
|
|
493 | (1) |
|
Completing the Subscriptions Panel |
|
|
494 | (1) |
|
Allowing Users to Subscribe to a Feed |
|
|
494 | (11) |
|
Allowing Users to Unsubscribe from a Feed |
|
|
505 | (1) |
|
Saving the Subscriptions List Between Sessions |
|
|
505 | (3) |
|
Refreshing the Subscriptions List |
|
|
508 | (3) |
|
Completing the Articles and Article Panels |
|
|
511 | (1) |
|
Finishing the Articles Panel |
|
|
511 | (5) |
|
Finishing the Article Panel |
|
|
516 | (2) |
|
Improving the Feed Reader |
|
|
518 | (1) |
Summary |
|
519 | (2) |
Index |
|
521 | |