Foreword |
|
xii | |
About the Author |
|
xiii | |
About the Technical Reviewer |
|
xiv | |
About the Cover Image Designer |
|
xv | |
Acknowledgments |
|
xvi | |
Introduction |
|
xvii | |
|
PART ONE ACTIONSCRIPTED ANIMATION BASICS |
|
|
1 | (98) |
|
|
3 | (10) |
|
|
4 | (1) |
|
|
5 | (2) |
|
|
6 | (1) |
|
|
7 | (1) |
|
Dynamic vs. static animation |
|
|
7 | (3) |
|
|
10 | (3) |
|
Basics of ActionScript for Animation |
|
|
13 | (28) |
|
|
14 | (14) |
|
|
14 | (1) |
|
|
14 | (1) |
|
|
15 | (4) |
|
|
19 | (1) |
|
|
20 | (3) |
|
Flash MX events and event handlers |
|
|
23 | (1) |
|
|
24 | (1) |
|
|
25 | (2) |
|
|
27 | (1) |
|
|
28 | (4) |
|
Movie clip symbols and instances |
|
|
29 | (1) |
|
|
29 | (1) |
|
|
29 | (1) |
|
|
29 | (3) |
|
Creating empty movie clips |
|
|
32 | (1) |
|
|
32 | (4) |
|
|
33 | (1) |
|
|
34 | (1) |
|
|
34 | (1) |
|
|
35 | (1) |
|
|
36 | (3) |
|
|
36 | (1) |
|
|
37 | (1) |
|
|
38 | (1) |
|
|
38 | (1) |
|
|
39 | (2) |
|
Trigonometry for Animation |
|
|
41 | (28) |
|
|
42 | (1) |
|
|
42 | (5) |
|
|
43 | (1) |
|
Flash's coordinate system |
|
|
44 | (3) |
|
|
47 | (1) |
|
|
47 | (6) |
|
|
47 | (2) |
|
|
49 | (1) |
|
|
50 | (1) |
|
|
51 | (1) |
|
|
51 | (2) |
|
|
53 | (2) |
|
|
55 | (5) |
|
Smooth up and down motion |
|
|
57 | (1) |
|
|
58 | (1) |
|
|
58 | (1) |
|
|
59 | (1) |
|
Waves with the drawing API |
|
|
59 | (1) |
|
|
60 | (2) |
|
|
60 | (2) |
|
|
62 | (1) |
|
|
62 | (1) |
|
Distance between two points |
|
|
63 | (2) |
|
Important formulas in this chapter |
|
|
65 | (2) |
|
|
67 | (2) |
|
|
69 | (30) |
|
|
70 | (3) |
|
Using hexadecimal color values |
|
|
70 | (1) |
|
|
71 | (2) |
|
Extracting component colors |
|
|
73 | (1) |
|
|
73 | (14) |
|
Removing drawing with clear |
|
|
74 | (1) |
|
Setting line appearance with lineStyle |
|
|
75 | (1) |
|
Drawing lines with lineTo and moveTo |
|
|
75 | (2) |
|
Drawing curves with curveTo |
|
|
77 | (1) |
|
Curving through the control point |
|
|
78 | (1) |
|
|
78 | (4) |
|
Creating shapes with beginFill and endFill |
|
|
82 | (1) |
|
Creating gradient fills with beginGradientFill |
|
|
83 | (1) |
|
|
83 | (1) |
|
Setting the colors, alphas, and ratios |
|
|
83 | (1) |
|
|
84 | (3) |
|
|
87 | (4) |
|
Changing color with the Color object |
|
|
87 | (1) |
|
Setting a single color with setRGB |
|
|
87 | (1) |
|
Transforming colors with setTransform |
|
|
88 | (1) |
|
Changing colors with the ColorTransform object |
|
|
89 | (2) |
|
|
91 | (3) |
|
|
92 | (1) |
|
|
93 | (1) |
|
|
94 | (3) |
|
Important formulas in this chapter |
|
|
97 | (1) |
|
|
98 | (1) |
|
|
99 | (62) |
|
Velocity and Acceleration |
|
|
101 | (22) |
|
|
102 | (7) |
|
|
102 | (2) |
|
|
104 | (1) |
|
|
105 | (1) |
|
|
105 | (2) |
|
|
107 | (1) |
|
|
108 | (1) |
|
|
108 | (1) |
|
|
109 | (11) |
|
|
110 | (2) |
|
|
112 | (1) |
|
|
113 | (2) |
|
|
115 | (1) |
|
|
116 | (2) |
|
|
118 | (1) |
|
|
119 | (1) |
|
Important formulas in this chapter |
|
|
120 | (1) |
|
|
121 | (2) |
|
|
123 | (24) |
|
|
124 | (15) |
|
|
124 | (2) |
|
|
126 | (4) |
|
|
130 | (2) |
|
|
132 | (2) |
|
|
134 | (5) |
|
|
139 | (5) |
|
|
140 | (1) |
|
|
141 | (1) |
|
|
142 | (2) |
|
Important formulas in this chapter |
|
|
144 | (1) |
|
|
145 | (2) |
|
User Interaction: Moving Objects Around |
|
|
147 | (14) |
|
Pressing and releasing a movie clip |
|
|
148 | (2) |
|
|
150 | (6) |
|
|
151 | (1) |
|
Dragging with startDrag/stopDrag |
|
|
152 | (1) |
|
Combining dragging with motion code |
|
|
152 | (4) |
|
|
156 | (3) |
|
|
159 | (2) |
|
PART THREE ADVANCED MOTION |
|
|
161 | (162) |
|
|
163 | (26) |
|
|
164 | (1) |
|
|
164 | (8) |
|
|
165 | (3) |
|
|
168 | (2) |
|
|
170 | (1) |
|
Easing isn't just for motion |
|
|
171 | (1) |
|
|
171 | (1) |
|
|
171 | (1) |
|
|
172 | (1) |
|
|
172 | (1) |
|
|
172 | (14) |
|
Springing in one dimension |
|
|
173 | (2) |
|
Springing in two dimensions |
|
|
175 | (1) |
|
Springing to a moving target |
|
|
175 | (1) |
|
|
176 | (1) |
|
|
177 | (3) |
|
Springing to multiple targets |
|
|
180 | (2) |
|
|
182 | (1) |
|
Attaching multiple objects with springs |
|
|
183 | (3) |
|
Important formulas in this chapter |
|
|
186 | (1) |
|
|
187 | (2) |
|
|
189 | (22) |
|
Collision detection methods |
|
|
190 | (1) |
|
|
190 | (6) |
|
Hit testing two movie clips |
|
|
191 | (3) |
|
Hit testing a movie clip and a point |
|
|
194 | (1) |
|
Hit testing with shapeFlag |
|
|
195 | (1) |
|
|
196 | (1) |
|
Distance-based collision detection |
|
|
196 | (6) |
|
Simple distance-based collision detection |
|
|
197 | (2) |
|
Collision-based springing |
|
|
199 | (3) |
|
Multiple-object collision detection strategies |
|
|
202 | (6) |
|
Basic multiple-object collision detection |
|
|
202 | (2) |
|
Multiple-object springing |
|
|
204 | (4) |
|
Important formulas in this chapter |
|
|
208 | (1) |
|
|
208 | (3) |
|
Coordinate Rotation and Bouncing Off Angles |
|
|
211 | (24) |
|
Simple coordinate rotation |
|
|
212 | (1) |
|
Advanced coordinate rotation |
|
|
213 | (4) |
|
|
214 | (1) |
|
Rotating multiple objects |
|
|
215 | (2) |
|
|
217 | (15) |
|
|
220 | (2) |
|
|
222 | (2) |
|
|
224 | (1) |
|
Fixing the ``falling off the edge'' problem |
|
|
224 | (1) |
|
|
224 | (1) |
|
|
225 | (1) |
|
Fixing the ``under the line'' problem |
|
|
226 | (2) |
|
Bouncing off multiple angles |
|
|
228 | (4) |
|
Important formulas in this chapter |
|
|
232 | (1) |
|
|
232 | (3) |
|
|
235 | (28) |
|
|
236 | (1) |
|
|
237 | (1) |
|
|
237 | (23) |
|
Conservation of momentum on one axis |
|
|
239 | (2) |
|
|
241 | (1) |
|
|
242 | (1) |
|
Conservation of momentum on two axes |
|
|
243 | (1) |
|
Understanding the theory and strategy |
|
|
243 | (4) |
|
|
247 | (9) |
|
|
256 | (2) |
|
Solving a potential problem |
|
|
258 | (2) |
|
Important formulas in this chapter |
|
|
260 | (1) |
|
|
261 | (2) |
|
Particle Attraction and Gravity |
|
|
263 | (18) |
|
|
264 | (1) |
|
|
265 | (5) |
|
|
265 | (3) |
|
Collision detection and reaction |
|
|
268 | (1) |
|
|
269 | (1) |
|
|
270 | (8) |
|
|
270 | (2) |
|
|
272 | (2) |
|
|
274 | (2) |
|
|
276 | (2) |
|
Important formulas in this chapter |
|
|
278 | (1) |
|
|
278 | (3) |
|
Forward Kinematics: Making Things Walk |
|
|
281 | (24) |
|
Introducing forward and inverse kinematics |
|
|
282 | (1) |
|
Getting started programming forward kinematics |
|
|
283 | (3) |
|
|
283 | (2) |
|
|
285 | (1) |
|
|
286 | (6) |
|
Building a natural walk cycle |
|
|
287 | (3) |
|
|
290 | (2) |
|
|
292 | (10) |
|
|
292 | (1) |
|
|
293 | (1) |
|
|
294 | (2) |
|
|
296 | (2) |
|
Screen wrapping, revisited |
|
|
298 | (4) |
|
|
302 | (3) |
|
Inverse Kinematics: Dragging and Reaching |
|
|
305 | (18) |
|
Reaching and dragging single segments |
|
|
306 | (2) |
|
Reaching with a single segment |
|
|
306 | (1) |
|
Dragging with a single segment |
|
|
307 | (1) |
|
Dragging multiple segments |
|
|
308 | (2) |
|
|
308 | (1) |
|
|
309 | (1) |
|
Reaching with multiple segments |
|
|
310 | (7) |
|
|
310 | (4) |
|
|
314 | (2) |
|
|
316 | (1) |
|
Using the standard inverse kinematics method |
|
|
317 | (5) |
|
Introducing the law of cosines |
|
|
318 | (2) |
|
ActionScripting the law of cosines |
|
|
320 | (2) |
|
Important formulas in this chapter |
|
|
322 | (1) |
|
|
322 | (1) |
|
|
323 | (88) |
|
|
325 | (34) |
|
The third dimension and perspective |
|
|
326 | (6) |
|
|
326 | (2) |
|
|
328 | (1) |
|
|
328 | (1) |
|
Perspective in ActionScript |
|
|
329 | (3) |
|
Velocity and acceleration |
|
|
332 | (1) |
|
|
333 | (5) |
|
|
333 | (3) |
|
|
336 | (2) |
|
|
338 | (1) |
|
|
338 | (3) |
|
|
341 | (6) |
|
|
347 | (3) |
|
|
347 | (1) |
|
|
348 | (2) |
|
|
350 | (5) |
|
|
355 | (2) |
|
Important formulas in this chapter |
|
|
357 | (1) |
|
|
357 | (2) |
|
|
359 | (28) |
|
Creating points and lines |
|
|
360 | (3) |
|
|
363 | (4) |
|
|
367 | (7) |
|
|
368 | (5) |
|
Defining the triangles' colors |
|
|
373 | (1) |
|
|
374 | (8) |
|
|
374 | (3) |
|
|
377 | (1) |
|
|
377 | (1) |
|
|
378 | (2) |
|
|
380 | (2) |
|
|
382 | (3) |
|
|
385 | (2) |
|
Backface Culling and 3D Lighting |
|
|
387 | (24) |
|
|
388 | (6) |
|
|
394 | (6) |
|
|
400 | (10) |
|
|
410 | (1) |
|
PART FIVE ADDITIONAL TECHNIQUES |
|
|
411 | (46) |
|
|
413 | (14) |
|
|
414 | (1) |
|
|
414 | (7) |
|
|
415 | (1) |
|
|
416 | (1) |
|
|
416 | (1) |
|
Coordinate rotation with a matrix |
|
|
417 | (1) |
|
|
418 | (3) |
|
The Matrix class in Flash 8 |
|
|
421 | (4) |
|
|
425 | (2) |
|
|
427 | (30) |
|
|
428 | (3) |
|
|
431 | (7) |
|
|
431 | (2) |
|
|
433 | (2) |
|
|
435 | (3) |
|
Interval-and timer-based animation |
|
|
438 | (5) |
|
|
439 | (2) |
|
|
441 | (2) |
|
Collisions between same-mass objects |
|
|
443 | (1) |
|
|
444 | (3) |
|
|
447 | (10) |
|
|
447 | (1) |
|
|
448 | (1) |
|
|
449 | (1) |
|
|
449 | (1) |
|
|
450 | (2) |
|
|
452 | (1) |
|
|
452 | (1) |
|
|
453 | (1) |
|
|
453 | (1) |
|
|
454 | (1) |
|
|
454 | (3) |
Index |
|
457 | |