Tải bản đầy đủ (.pdf) (85 trang)

Flash CS5 THE MISSING MANUAL phần 1 pdf

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (3.96 MB, 85 trang )

Flash CS5
THE MISSING MANUAL
The book that
should have been
in the box
®ˇ

Flash CS5
Beijing  

  Cambridge  

  Farnham  

  Köln  

  Sebas topol  

  Taipei  

  Tokyo
Chris Grover
Flash CS5: The Missing Manual
by Chris Grover
Copyright © 2010 Chris Grover. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North,
Sebastopol, CA 95472.
O’Reilly Media books may be purchased for educational, business, or sales promotional use.


Online editions are also available for most titles: . For more
information, contact our corporate/institutional sales department: 800-998-9938 or corporate@
oreilly.com.
May 2010: First Edition.
The Missing Manual is a registered trademark of O’Reilly Media, Inc. The Missing Manual logo,
and “The book that should have been in the box” are trademarks of O’Reilly Media, Inc. Many
of the designations used by manufacturers and sellers to distinguish their products are claimed
as trademarks. Where those designations appear in this book, and O’Reilly Media is aware of a
trademark claim, the designations are capitalized.
While every precaution has been taken in the preparation of this book, the publisher assumes no
responsibility for errors or omissions, or for damages resulting from the use of the information
contained in it.
This book uses a durable and flexible lay-flat binding.
ISBN: 978-1-449-38025-0
[M]
v
Table of Contents
The Missing Credits . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Part One: Creating a Flash Animation
Chapter 1: Getting Around Flash . . . . . . . . . . . . . . . . . . . . 13
Starting Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
A Tour of the Flash Workspace
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Menu Bar
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
The Stage
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
The Timeline
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

Panels and Toolbars
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Toolbars
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Tools Panel
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Properties Panel
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Library Panel
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Other Flash Panels
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
The Flash CS5 Test Drive
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Open a Flash File
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Explore the Properties Panel
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Resize the Stage
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Zoom In and Out
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Make It Move
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Play an Animation
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Save a File
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Chapter 2: Creating Simple Drawings . . . . . . . . . . . . . . . . . 41
Plan Before You Draw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

Creating a Storyboard
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Five Questions for a Better Result
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
vi
  
Preparing to Draw
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Setting Document Properties
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Adding Measurement Guides
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Drawing a Shape
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Choosing a Drawing Mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Merge Drawing Mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Object Drawing Mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Using Merge Mode and Object Mode Together
. . . . . . . . . . . . . . . . . . . . . 57
Selecting Objects on the Stage
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Essential Drawing Terms
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Creating Original Artwork
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Drawing and Painting with Tools
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

Aligning Objects with the Align Tools
. . . . . . . . . . . . . . . . . . . . . . . . . . 74
Erasing Mistakes with the Eraser Tool
. . . . . . . . . . . . . . . . . . . . . . . . . . 75
Copying and Pasting Drawn Objects
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Adding Color
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Changing the Color of a Stroke (Line)
. . . . . . . . . . . . . . . . . . . . . . . . . . 80
Changing the Color of a Fill
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Chapter 3: Animate Your Art . . . . . . . . . . . . . . . . . . . . . . 87
Frame-by-Frame Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Creating a Frame-by-Frame Animation
. . . . . . . . . . . . . . . . . . . . . . . . . 88
Test Your Frame-by-Frame Animation
. . . . . . . . . . . . . . . . . . . . . . . . . . 92
Editing Your Frame-by-Frame Animation
. . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Selecting Frames and Keyframes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Inserting and Deleting Keyframes and Frames
. . . . . . . . . . . . . . . . . . . . . 95
Making It Move with Motion Tweens
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Tweening a Symbol’s Dimension Properties
. . . . . . . . . . . . . . . . . . . . . 102
Copying and Pasting Frames
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

Reversing Frames in a Frame Span
. . . . . . . . . . . . . . . . . . . . . . . . . . 106
Editing the Motion Path
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Moving the Motion Path
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Adding Curves to the Motion Path
. . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Moving End Points on the Motion Path
. . . . . . . . . . . . . . . . . . . . . . . . 109
Copying and Pasting a Motion Path
. . . . . . . . . . . . . . . . . . . . . . . . . . 109
Copying and Pasting Properties
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Shape Tweening (Morphing)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Shape Hints
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Using Multiple Layers for Shape Tweens
. . . . . . . . . . . . . . . . . . . . . . . 117
Classic Tween
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
vii
  
Part Two: Advanced Drawing and Animation
Chapter 4: Organizing Frames and Layers . . . . . . . . . . . . . . 121
Working with Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Copying and Pasting Frames
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Moving Frames and Keyframes

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Editing Multiple Frames
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Working with Multiple Layers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Showing and Hiding Layers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Working with Layers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Renaming Layers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Copying and Pasting Layers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Reordering (Moving) Layers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Deleting a Layer
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Locking and Unlocking Layers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Organizing Layers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Outline View
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Organizing Layers with Folders
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Spotlight Effect Using Mask Layers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Chapter 5: Advanced Drawing and Coloring . . . . . . . . . . . . 149
Selecting Graphic Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
The Selection Tool

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
The Subselection Tool
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
The Lasso Tool
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Manipulating Graphic Elements
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Modifying Object Properties
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Moving, Cutting, Pasting, and Copying
. . . . . . . . . . . . . . . . . . . . . . . . . 164
Transforming Objects
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Moving and Rotating Objects in 3-D
. . . . . . . . . . . . . . . . . . . . . . . . . . 173
Stacking Objects
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Converting Strokes to Fills
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Aligning Objects
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Spray Painting Symbols
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Drawing with the Deco Tool
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Advanced Color and Fills
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Color Basics
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
RGB and HSB

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Creating Custom Colors
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Specifying Colors for ActionScript
. . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Saving Color Swatches
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Using an Image As a Fill “Color”
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
viii
  
Applying a Gradient
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Importing a Custom Color Palette
. . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Copying Color with the Eyedropper
. . . . . . . . . . . . . . . . . . . . . . . . . . 204
Chapter 6: Choosing and Formatting Text . . . . . . . . . . . . . . 209
Text Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Choosing TLF or Classic Text
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Choose a Text Type
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
About Typefaces and Fonts
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Adding Text to Your Document
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Changing Text Position, Height, and Width
. . . . . . . . . . . . . . . . . . . . . . 216
Rotating, Skewing, and Moving in 3-D

. . . . . . . . . . . . . . . . . . . . . . . . . 217
Changing Text Color
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Creating a Text Hyperlink
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Creating a Hyperlink Using Classic Text
. . . . . . . . . . . . . . . . . . . . . . . . 219
Choosing and Using Text Containers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Creating Vertical Text Containers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Multiline and Single-Line Text Containers
. . . . . . . . . . . . . . . . . . . . . . . 222
Applying Advanced Formatting to Text
. . . . . . . . . . . . . . . . . . . . . . . . . 223
Create a Multi-Column Text Container
. . . . . . . . . . . . . . . . . . . . . . . . . 224
Flow Text from One Container to Another
. . . . . . . . . . . . . . . . . . . . . . . 225
Animating Text Without ActionScript
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Experimenting with Animated Text
. . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Moving Text in Three Dimensions
. . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Text Properties by Subpanel
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Text Engine Properties
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Position and Size

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
3D Position and View (TLF Text Only)
. . . . . . . . . . . . . . . . . . . . . . . . . 233
Character
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Advanced Character (TLF Text Only)
. . . . . . . . . . . . . . . . . . . . . . . . . . 235
Paragraph
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Options (Classic Text Only)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Container and Flow (TLF Text Only)
. . . . . . . . . . . . . . . . . . . . . . . . . . 236
Color Effect (TLF Text Only)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Display (TLF Text Only)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Filters
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Chapter 7: Reusable Flash: Symbols and Templates . . . . . . . . 239
Symbols and Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Graphic Symbols
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Multiframe Graphic Symbols
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Movie Clip Symbols
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Button Symbols
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
Templates

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Opening a Prebuilt Template
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Customizing the Photo Album Template
. . . . . . . . . . . . . . . . . . . . . . . . 278
ix
  
Chapter 8: Advanced Tweens with the Motion Editor . . . . . . . 287
Applying Motion Presets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Saving a Custom Motion Preset
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Modifying a Motion Preset
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Changing the Motion Path
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Deleting a Motion Path
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Copying and Pasting a Motion Path
. . . . . . . . . . . . . . . . . . . . . . . . . . 294
Orienting Tweened Objects to a Motion Path
. . . . . . . . . . . . . . . . . . . . . 296
Swapping the Tweened Object
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Editing a Tween Span
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Viewing and Editing Property Keyframes in the Timeline
. . . . . . . . . . . . . . . 300
Copying Properties Between Property Keyframes
. . . . . . . . . . . . . . . . . . . 302
A Tour of the Motion Editor

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Workflow for Common Tweens
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
Adding and Removing Property Keyframes
. . . . . . . . . . . . . . . . . . . . . . 305
Moving Property Keyframes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Fine-Tuning Property Changes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Adding and Removing Color Effects
. . . . . . . . . . . . . . . . . . . . . . . . . . 307
Using Filters in Tweens
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Customizing Your Motion Editor View
. . . . . . . . . . . . . . . . . . . . . . . . . 308
Changing Transparency with the Motion Editor
. . . . . . . . . . . . . . . . . . . . . . 310
Easing Tweens
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Applying an Ease Preset
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Creating a Custom Ease Preset
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Chapter 9: Realistic Animation with IK Bones . . . . . . . . . . . 317
Linking Symbols with Bones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
Changing the Pose Layer
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Creating Branching Armatures
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
Controlling the Degree of Rotation

. . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Moving Bones
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Repositioning Symbol Instances
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Changing the Length of a Bone
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Deleting Bones
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Making Shapes Move with Bones
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
Working with Control Points
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Apply Spring to a Motion
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
Animating an Armature with ActionScript
. . . . . . . . . . . . . . . . . . . . . . . . . 338
Chapter 10: Incorporating Non-Flash Media Files . . . . . . . . . 339
Importing Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Importing Illustrator Graphics Files
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Importing Photoshop Graphic Files
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Importing Fireworks Graphics
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Import Options for Graphics
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
Copying Fireworks Effects and Blends
. . . . . . . . . . . . . . . . . . . . . . . . . 353
x

  
Editing Bitmaps
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
Importing a Series of Graphics Files
. . . . . . . . . . . . . . . . . . . . . . . . . . 356
Exporting Graphics from Flash
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
Chapter 11: Incorporating Sound and Video . . . . . . . . . . . . 361
Incorporating Sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Importing Sound Files
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Adding an Imported Sound to a Frame (or Series of Frames)
. . . . . . . . . . . . 364
Editing Sound Clips in Flash
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Incorporating Video
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Encoding: Making Flash Video Files
. . . . . . . . . . . . . . . . . . . . . . . . . . 372
Encoding Part of a Video Clip
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Resizing and Cropping a Video Clip
. . . . . . . . . . . . . . . . . . . . . . . . . . 377
Adding Cue Points to Your Video
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
Choosing a Video Codec
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Other Techniques for Reducing Video File Sizes
. . . . . . . . . . . . . . . . . . . . 383
Preparing to Import Video Files

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
Importing Video Files
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Importing a Flash Video File Stored on Your Computer
. . . . . . . . . . . . . . . . 385
Importing a Flash Video from the Web
. . . . . . . . . . . . . . . . . . . . . . . . 391
Customizing the Video Playback Component
. . . . . . . . . . . . . . . . . . . . . 391
Part Three: Adding Interactivity
Chapter 12: Introduction to ActionScript 3 . . . . . . . . . . . . . 395
Getting to Know ActionScript 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
The Flash/ActionScript Partnership
. . . . . . . . . . . . . . . . . . . . . . . . . . 396
ActionScript 3
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
ActionScript vs. JavaScript and Other Languages
. . . . . . . . . . . . . . . . . . . 397
ActionScript 3 Spoken Here
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Beginning Your ActionScript Project
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Writing ActionScript Code in the Timeline
. . . . . . . . . . . . . . . . . . . . . . . 403
Using the Script Pane Toolbar
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Writing Code in an ActionScript File
. . . . . . . . . . . . . . . . . . . . . . . . . . 405
Object-Oriented Thinking
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407

ActionScript Classes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Changing an Object’s Properties
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Functions and Methods Put the Action in ActionScript
. . . . . . . . . . . . . . . . 413
Events
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Using Data Types, Variables, and Constants
. . . . . . . . . . . . . . . . . . . . . . . . 417
Numbers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Strings
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Boolean
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Arrays
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
ActionScript Built-in Data Types
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
xi
  
Variables
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Constants
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Conditionals and Loops
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Conditionals: if() and switch() Statements
. . . . . . . . . . . . . . . . . . . . . . . 423

Loops: while() and for() Statements
. . . . . . . . . . . . . . . . . . . . . . . . . . 425
Combining ActionScript’s Building Blocks
. . . . . . . . . . . . . . . . . . . . . . . . . 427
Chapter 13: Controlling Actions with Events . . . . . . . . . . . . 429
How Events Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Mouse Events
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
Getting Help for Events and Event Listeners
. . . . . . . . . . . . . . . . . . . . . . . . 434
Creating a Rollover with a Mouse Event
. . . . . . . . . . . . . . . . . . . . . . . . 435
Add Statements to an Event Listener
. . . . . . . . . . . . . . . . . . . . . . . . . . 439
Creating a Tabbed Window with Mouse Events
. . . . . . . . . . . . . . . . . . . . . . 441
Setting the Stage for Tabbed Folder Display
. . . . . . . . . . . . . . . . . . . . . . 441
Planning Before Coding
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
Copy-and-Tweak Coding
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
Keyboard Events and Text Events
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
Using Event Properties
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
Capturing Text Input with TextEvent
. . . . . . . . . . . . . . . . . . . . . . . . . . 459
Keeping Time with TimerEvent
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460

Removing Event Listeners
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
In Case of Other Events
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
Chapter 14: Organizing Objects with the Display List . . . . . . . 463
The Display List: Everything in Its Place . . . . . . . . . . . . . . . . . . . . . . . . . . 463
When Display Objects are Display Object Containers
. . . . . . . . . . . . . . . . . 464
Adding Objects to the Display List
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
Add a Second Object to the Display List
. . . . . . . . . . . . . . . . . . . . . . . . 467
Using trace() to Report on the Display List
. . . . . . . . . . . . . . . . . . . . . . 470
Placing Objects Inside Display Containers
. . . . . . . . . . . . . . . . . . . . . . . 472
Moving Objects from One Container to Another
. . . . . . . . . . . . . . . . . . . 476
Removing Objects from the Display List
. . . . . . . . . . . . . . . . . . . . . . . . 479
Managing the Stacking Order
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Adding Display Objects by Index Position
. . . . . . . . . . . . . . . . . . . . . . . 482
Removing Display Objects by Index Position
. . . . . . . . . . . . . . . . . . . . . 484
Getting the Name or Index Position of a Display Object
. . . . . . . . . . . . . . . 485
Swapping the Position of Two Children
. . . . . . . . . . . . . . . . . . . . . . . . 487

Summary of Properties and Methods
. . . . . . . . . . . . . . . . . . . . . . . . . . . 487
DisplayObjectContainer Properties
. . . . . . . . . . . . . . . . . . . . . . . . . . 488
DisplayObjectContainer Methods
. . . . . . . . . . . . . . . . . . . . . . . . . . . 489
Chapter 15: Controlling the Timeline and Animation . . . . . . . 493
Slowing Down (or Speeding Up) Animation . . . . . . . . . . . . . . . . . . . . . . . . 493
Setting a Document Frame Rate
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
Setting a Frame Rate with ActionScript
. . . . . . . . . . . . . . . . . . . . . . . . 497
xii
  
Timeline Stop and Go
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
Using ActionScript to Start a Timeline
. . . . . . . . . . . . . . . . . . . . . . . . . 500
Organizing Your Animation
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
Working with Labeled Frames
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
Working with Scenes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
Looping a Series of Frames
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
Reversing a Series of Frames
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
Reversing Frames in the Timeline
. . . . . . . . . . . . . . . . . . . . . . . . . . . 516

Chapter 16: Components for Interactivity . . . . . . . . . . . . . . 519
Adding Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
Making Button Components Work with ActionScript
. . . . . . . . . . . . . . . . . 526
Modifying Components in the Properties Panel
. . . . . . . . . . . . . . . . . . . . 528
Adding a ColorPicker Component
. . . . . . . . . . . . . . . . . . . . . . . . . . . 530
The Built-In Components
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
User Interface Components
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
Finding Additional Components
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
Chapter 17: Choosing, Using, and Animating Text . . . . . . . . . 555
What Font Does Your Audience Have? . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
Embedding Fonts in Your SWF file
. . . . . . . . . . . . . . . . . . . . . . . . . . . 556
Controlling Text with ActionScript
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
ActionScript Text: String Theory
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
Creating a New String
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
Joining Strings
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
Using TextField’s appendText() Method
. . . . . . . . . . . . . . . . . . . . . . . . 561
Adding Line Breaks to a String
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562

Finding a String Within a String
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
Replacing Words or Characters in a String
. . . . . . . . . . . . . . . . . . . . . . . 564
Converting Strings to Uppercase or Lowercase
. . . . . . . . . . . . . . . . . . . . 564
Creating Text Fields with ActionScript
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Positioning, Sizing, and Formatting a Text Field
. . . . . . . . . . . . . . . . . . . . . . 566
Formatting the Text Field’s Background and Border
. . . . . . . . . . . . . . . . . . 566
Adjust the Space Between Text and Border
. . . . . . . . . . . . . . . . . . . . . . 567
Autosizing a Text Field
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
Formatting Characters and Paragraphs
. . . . . . . . . . . . . . . . . . . . . . . . . . . 569
Formatting with HTML and CSS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
HTML and CSS Philosophical Differences
. . . . . . . . . . . . . . . . . . . . . . . 572
Using HTML Text in Flash
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
Creating a Hyperlink with HTML
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
Using CSS to Format Classic Text in Flash
. . . . . . . . . . . . . . . . . . . . . . . 574
Formatting Text with an External CSS File
. . . . . . . . . . . . . . . . . . . . . . . 577

Choosing the Right Text Formatting System
. . . . . . . . . . . . . . . . . . . . . . . . 580
xiii
  
Chapter 18: Drawing with ActionScript. . . . . . . . . . . . . . . . 581
What’s the Point? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
Beginning with the Graphics Class
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
Drawing Lines
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
Drawing Curves
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
Drawing Built-in Shapes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
Drawing Irregular Shapes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
Making Drawings Move
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
Using ActionScript’s TimerEvent to Animate Drawings
. . . . . . . . . . . . . . . . 595
Moving Objects Independently
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
Shape, Sprite, and Movie Clip for Drawings
. . . . . . . . . . . . . . . . . . . . . . . . 599
Removing Lines and Shapes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
Part Four: Debugging and Delivering Your Animation
Chapter 19: Testing and Debugging Your Animation . . . . . . . 605
Testing Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
Planning Ahead

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
Techniques for Better Testing
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
Testing on the Stage
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
Testing in Flash Player
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
Testing Inside a Web Page
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
Testing Download Time
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
Simulating Downloads
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
The Art of Debugging
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
Checking with the Syntax Checker
. . . . . . . . . . . . . . . . . . . . . . . . . . . 622
Finding Errors with the Compiler Errors Panel
. . . . . . . . . . . . . . . . . . . . 624
Using the Output Panel and trace() Statement
. . . . . . . . . . . . . . . . . . . . 625
Analyzing Code with the Debugger
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
Setting and Working with Breakpoints
. . . . . . . . . . . . . . . . . . . . . . . . . 632
Chapter 20: Publishing and Exporting . . . . . . . . . . . . . . . . 637
Optimizing Flash Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
Ten Optimization Strategies
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
Publishing Your Animations

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
Publishing as a Compiled Flash (.swf) File
. . . . . . . . . . . . . . . . . . . . . . . 647
Publishing As a Web Page
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
Publishing a Frame as a Static Image File
. . . . . . . . . . . . . . . . . . . . . . . 659
Publishing as an Animated GIF
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
Publishing As a Standalone Projector
. . . . . . . . . . . . . . . . . . . . . . . . . 668
Exporting Flash to Other Formats
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
Exporting the Contents of a Single Frame
. . . . . . . . . . . . . . . . . . . . . . . 669
Exporting an Entire Animation
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
xiv
  
Chapter 21: Introducing Adobe AIR . . . . . . . . . . . . . . . . . . 673
Meet Adobe AIR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673
Differences Between AIR and Flash
. . . . . . . . . . . . . . . . . . . . . . . . . . 675
Creating Your First AIR Application
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
Create a Code Signing Certificate
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
Convert a Flash Animation to AIR
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
Publish Your AIR Application

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
Manually Install Adobe AIR Runtime
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
Part Five: Appendixes
Appendix A: Installation and Help . . . . . . . . . . . . . . . . . . 689
Appendix B: Flash Professional CS5, Menu by Menu . . . . . . . 701
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
xv
The Missing Credits
About the Author
Chris Grover is a veteran of the San Francisco Bay Area adver-
tising and design community, having worked for over 25 years in
print, video, and electronic media. He has been using and writing
about computers from the day he first fired up is Kaypro II. Chris
is the owner of Bolinas Road Creative (www.BolinasRoad.com),
an agency that helps small businesses promote their products and
services. He’s also the author of Premiere Elements 8: The Missing Manual, Google
SketchUp: The Missing Manual, Flash CS4: The Missing Manual, and Word 2007:
The Missing Manual.
About the Creative Team
Nan Barber (editor) has been working on the Missing Manual series since its in-
ception. She lives in Massachusetts with her husband and various Apple products.
Email:
Julie Van Keuren (copy editor) is a freelance editor, writer, and desktop publisher
who runs her “little media empire” from her home in Billings, Montana. In her
spare time she enjoys swimming, biking, running, and (hey, why not?) triathlons.
Email:
Rachel Monaghan (production editor) lives with her husband, John, in Nashville,
where they enjoy exploring their neighborhood, watching HBO, and harassing
their two cats, Henry and Olive. She has been with O’Reilly since 2005. Email:


xvi
  
Head A: Paragraph
Style
Ellen Troutman Zaig (indexer) is a freelance indexer who has eleven years’ experience
in back-of-the-book indexing. She specializes in topics in computer technology; in
addition, she has indexed college textbooks in many subject areas.
Keith Gladstien (technical reviewer) is a prolific contributor to the Adobe Flash
Forums who has been using Flash since version 4. He has a background in mathe-
matics (PhD, Purdue) and medicine (MD, Yale) and has created hundreds of Flash
applications for clients worldwide. Website: www.kglad.com.
Tina Spargo (technical reviewer), her husband (and professional musician) Ed, their
preschooler Max, their two silly Spaniels, Parker (Clumber), and Piper (Sussex), all
share time and space in their suburban Boston home. Tina juggles being an at-home
mom with promoting and marketing Ed’s musical projects and freelancing as a virtual
assistant. Tina has over 20 years’ experience supporting top-level executives in a vari-
ety of industries. Website: www.tinaspargo.com.
Acknowledgements
Thanks to all the pros on the Missing Manual team who worked to get this book
into your hands. A special thanks again to Nan Barber, whose skill, patience, and
planning has guided several of my books from concept to printing press. Thanks
also to Karen Shaner who helped coordinate the manuscript files flying back and
forth and to Julie Van Keuren for her copy editing eagle eye. Speaking of eagle
eyes, many thanks to Tina Spargo, one of my technical reviewers, for taking a fresh
look at the text and exercises in this book. A special thanks to Keith Gladstien for
his technical review and thoughts on Flash. His experience as a Flash master was
much appreciated. Thanks again to Joyce, my wife, whose love, proofreading, and
understanding help me in everything I do.
The Missing Manual Series

Missing Manuals are witty, superbly written guides to computer products that don’t
come with printed manuals (which is just about all of them). Each book features a
handcrafted index; cross-references to specific pages (not just chapters); and Rep-
Kover, a detached-spine binding that lets the book lie perfectly flat without the as-
sistance of weights or cinder blocks.
Recent and upcoming titles include:
Access 2007: The Missing Manual by Matthew MacDonald
Access 2010: The Missing Manual by Matthew MacDonald
Buying a Home: The Missing Manual by Nancy Conner
CSS: The Missing Manual, Second Edition, by David Sawyer McFarland
Creating a Web Site: The Missing Manual, Second Edition, by Matthew MacDonald
David Pogue’s Digital Photography: The Missing Manual by David Pogue
Header_Right
xvii
  
Dreamweaver CS4: The Missing Manual by David Sawyer McFarland
Dreamweaver CS5: The Missing Manual by David Sawyer McFarland
Excel 2007: The Missing Manual by Matthew MacDonald
Excel 2010: The Missing Manual by Matthew MacDonald
Facebook: The Missing Manual, Second Edition, by E.A. Vander Veer
FileMaker Pro 10: The Missing Manual by Susan Prosser and Geoff Coffey
FileMaker Pro 11: The Missing Manual by Susan Prosser and Stuart Gripman
Flash CS4: The Missing Manual by Chris Grover with E.A. Vander Veer
Google Apps: The Missing Manual by Nancy Conner
The Internet: The Missing Manual by David Pogue and J.D. Biersdorfer
iMovie ’08 & iDVD: The Missing Manual by David Pogue
iMovie ’09 & iDVD: The Missing Manual by David Pogue and Aaron Miller
iPad: The Missing Manual by J.D. Biersdorfer and David Pogue
iPhone: The Missing Manual, Second Edition, by David Pogue
iPhone App Development: The Missing Manual by Craig Hockenberry

iPhoto ’08: The Missing Manual by David Pogue
iPhoto ’09: The Missing Manual by David Pogue and J.D. Biersdorfer
iPod: The Missing Manual, Eighth Edition, by J.D. Biersdorfer and David Pogue
JavaScript: The Missing Manual by David Sawyer McFarland
Living Green: The Missing Manual by Nancy Conner
Mac OS X: The Missing Manual, Leopard Edition, by David Pogue
Mac OS X Snow Leopard: The Missing Manual by David Pogue
Microsoft Project 2007: The Missing Manual by Bonnie Biafore
Microsoft Project 2010: The Missing Manual by Bonnie Biafore
Netbooks: The Missing Manual by J.D. Biersdorfer
Office 2007: The Missing Manual by Chris Grover, Matthew MacDonald, and
E.A. Vander Veer
Office 2010: The Missing Manual by Nancy Connor, Chris Grover, and Matthew
MacDonald
Office 2008 for Macintosh: The Missing Manual by Jim Elferdink
Palm Pre: The Missing Manual by Ed Baig
Header_Left
xviii
  
PCs: The Missing Manual by Andy Rathbone
Personal Investing: The Missing Manual by Bonnie Biafore
Photoshop CS4: The Missing Manual by Lesa Snider
Photoshop CS5: The Missing Manual by Lesa Snider
Photoshop Elements 7: The Missing Manual by Barbara Brundage
Photoshop Elements 8 for Mac: The Missing Manual by Barbara Brundage
Photoshop Elements 8 for Windows: The Missing Manual by Barbara Brundage
PowerPoint 2007: The Missing Manual by E.A. Vander Veer
Premiere Elements 8: The Missing Manual by Chris Grover
QuickBase: The Missing Manual by Nancy Conner
QuickBooks 2010: The Missing Manual by Bonnie Biafore

QuickBooks 2011: The Missing Manual by Bonnie Biafore
Quicken 2009: The Missing Manual by Bonnie Biafore
Switching to the Mac: The Missing Manual, Leopard Edition, by David Pogue
Switching to the Mac: The Missing Manual, Snow Leopard Edition, by David Pogue
Wikipedia: The Missing Manual by John Broughton
Windows XP Home Edition: The Missing Manual, Second Edition, by David Pogue
Windows XP Pro: The Missing Manual, Second Edition, by David Pogue, Craig
Zacker, and Linda Zacker
Windows Vista: The Missing Manual by David Pogue
Windows 7: The Missing Manual by David Pogue
Word 2007: The Missing Manual by Chris Grover
Your Body: The Missing Manual by Matthew MacDonald
Your Brain: The Missing Manual by Matthew MacDonald
Your Money: The Missing Manual by J.D. Roth
1
Introduction
F
lash’s evolution is unique, even for the fast-changing computer software world.
First released in 1996 under the name FutureSplash, it was a tool for creating
web-based animations. It’s still the “go to” application for that job; however,
along the way it’s acquired new capabilities. Today, Flash powers video websites
like YouTube and Hulu (Figure I-1). It’s used to develop desktop applications like
eBay Desktop. As you read this, Flash/ActionScript pros are developing the next
generation of apps for handheld devices like the Droid and perhaps the iPhone.
Flash has grown up with the World Wide Web and managed to carve out an im-
portant niche. In fact, there are a whole slew of programs that make use of Flash
technology. They include Flex, Flash Builder, and Flash Catalyst. Still, if you want to
learn Flash’s design and animation features as well as its programming and develop-
ment features, then Flash Professional CS5 is the place to start.
Figure I-1:

Sites like Hulu and YouTube
have made great use of Flash’s
video abilities. You can check
any site to see whether it’s
using Flash behind the scenes.
Just right-click (or Control-click)
an image that you think might
be Flash. If it says “About Flash
Player” at the bottom of the
pop-up menu, you guessed
right.
Introduction
2
F CS: T M M
Here are just some of the things you can do with Flash:
• Animate. You can create original artwork using Flash’s tools, or you can add
images from your other favorite programs. Flash recognizes the most common
image, video, and sound file formats. Once your artwork is in Flash, you can
add motion, sound, and dazzling effects. Surely you’ve spent some quality time
watching JibJab cartoons (Figure I-2).
Figure I-2:
With a little creativity,
your Flash animations can
capture the public’s atten-
tion. Just ask the folks at
JibJab.
• Multimedia websites. Today’s websites aren’t static. They include motion, video,
background music, and above all interactive objects. Flash’s built-in program-
ming language, ActionScript, was designed to create interactive objects. You
can create eye-catching, attention-grabbing websites with Flash. It’s your choice

whether you sprinkle Flash bits on various pages or go whole-hog and develop
a 100 percent Flash site.
• Tutorials. Web-based training courses, which often include a combination of
text, drawings, animations, video clips, and voice-overs, are a natural fit for
Flash. By hooking Flash up to a server on the back end, you can even present
your audience with graded tests and up-to-the-minute product information.
You don’t have to deliver your tutorials over the web, though; you can publish
them as standalone projector files (Chapter 20) or AIR applications (Chapter 21)
and deliver them to your students via CDs or DVDs.
Introduction
4
F CS: T M M
• Code snippets are great for when you need to build something quickly. Snip-
pets are cut-and-paste bits of code that you can drop into your ActionScript
programs. Organized by topic and function—like Timeline Navigation, Event
Handlers, or Audio and Video—snippets are great learning tools.
• Code hinting is another area where ActionScript has improved. Turn code
hinting on, and the Actions panel offers truly helpful suggestions as you write
your code. It’s easy to use the hints or to ignore them. It’s your call.
• Workflow improvements. Adobe wants you to use its entire suite of programs
when you create your masterpiece, so with each version, it improves the way
Flash works with other programs like Photoshop, Illustrator, and InDesign.
Newer tools like Flex, Flash Builder, and Flash Catalyst make it easier for
teams of designers and programmers to divvy up application development
chores.
• AIR (Adobe Integrated Runtime) is used to develop desktop applications. It’s
now easier to create and publish AIR applications in Flash. You’ll find the details
in Chapter 21.
• Packaging applications for the iPhone. For years, developers have used Flash
to build applications for handheld devices. Flash Professional CS5 includes a

packager designed specifically for the iPhone. It turns out that Apple doesn’t
want developers creating apps with tools like Flash, so at the time this was writ-
ten, the usefulness of this feature was up in the air.
Animation ABCs
Animators used to draw each and every frame by hand. Sure, they developed some
shortcuts, but that’s still hundreds or thousands of images depending on the length
of the animation. Major animation houses employed whole armies of graphic artists,
each charged with producing hundreds of drawings that represented a mere fraction
of the finished work. What we chuckled at for a scant few minutes took weeks and
dozens of tired, cramped hands to produce. One mistake, one spilled drop of cof-
fee, and these patient-as-Job types would have to grab fresh paper and start all over
again. When everything was done, the animation would have to be put together—
much like one of those flip books where you flip pages real fast to see a story play
out—while it was being filmed by special cameras.
With Flash on your computer, you have the equivalent of a design studio at your
fingertips. You provide the inspiration, and Flash can help you generate pro-quality
animations and full-blown interactive applications.
It’s pretty incredible, when you think about it. A few hundred bucks and a few hours
spent working with Flash, and you’ve got an animation that, just a few years ago,
you’d have had to pay a swarm of professionals union scale to produce. Sweet! Natu-
rally, if you’re new to animation, it will go easier if you learn the basic terms, tricks,
and techniques used by Flash animators.
Introduction
5
I
UP TO SPEED
An Animation by Any Other Name
You may occasionally hear Flash animations referred to (by
books, websites, and even Flash’s own documentation) as
movies. Perhaps that’s technically accurate, but it sure can

be confusing.
QuickTime’s .mov files are also called movies, and some
people refer to video clips as movies; but to Flash, these
are two very different animals. In addition, Flash lets you
create and work with movie clips, which are something else
entirely. And “movie,” with its connotations of quietly sitting
in a theater balcony eating popcorn, doesn’t convey one of
the most important features Flash offers: interactivity.
Here’s the most accurate way to describe what you cre-
ate using Flash: a website or program with a really cool,
animated interface. Unfortunately, that description is a bit
long and unwieldy, so in this book, what you create using
Flash is called an animation.
Flash in a Nutshell
Say you work for a company that does custom auto refinishing. First assignment:
Design an intro page for the company’s new website. You have the following idea for
an animation:
The first thing you want your audience to see is a beat-up jalopy limping along a
city street toward the center of the screen, where it stops and morphs into a shiny,
like-new car as your company’s jingle plays in the background. A voice-over informs
your audience that your company has been in business for 20 years and offers the
best prices in town.
Across the top of the screen, you’d like to display the company logo, as well as a
navigation bar with buttons—labeled Location, Services, Prices, and Contact—that
your audience can click to get more information about your company. But you also
want each part of the car to be a clickable hotspot. That way, when someone clicks
one of the car’s tires, he’s whisked off to a page describing your custom wheels and
hubcaps; when he clicks the car’s body, he sees prices for dent repair and repainting;
and so on.
Here’s how you might go about creating this animation in Flash:

• Using Flash’s drawing tools, you draw the artwork for every keyframe of the
animation—that is, every important image. For example, you’ll need to create a
keyframe showing the beat-up junker and a second keyframe showing the gleam-
ing, expertly refurbished result. (Chapter 2 shows you how to draw artwork in
Flash; Chapter 3 tells you everything you need to know about keyframes.)
• Within each keyframe, you might choose to separate your artwork into different
layers. Like the see-through plastic cels that professional animators used in the
old days, layers let you create images separately and then stack them on top of
one another to make a single composite image. For example, you might choose
to put the car on one layer, your company logo on a second layer, and your
Introduction
6
F CS: T M M
city-street background on a third layer. That way, you can edit and animate each
layer independently, but when the animation plays, all three elements appear to
be on one seamless layer. (Chapter 4 shows you how to work with layers.)
• Through a process called tweening, you tell Flash to fill in each and every frame
between the keyframes to create the illusion of the junker turning slowly into
a brand-new car. Flash carefully analyzes all the differences between the key-
frames and does its best to build the interim frames, which you can then tweak
or—if Flash gets it all wrong—redraw yourself. (Chapter 3 introduces tweens,
and Chapter 8 gives you the lowdown on advanced techniques.)
• As you go along, you might decide to save a few of the elements you create (for
example, your company logo) so you can reuse them later. There’s no sense in
reinventing the wheel, and in addition to saving you time, reusing elements
actually helps keep your animation files as small and efficient as possible. (See
Chapter 7 for details on creating and managing reusable elements.)
• Add the background music and voice-over audio clips, which you’ve created in
other programs (Chapter 11).
• Create the navigation bar buttons and hotspots and other ways for your audi-

ence to interact with your animation (Chapters 12–18).
• Test your animation (Chapter 19) and tweak it to perfection.
• Finally, when your animation is just the way you want it, you’re ready to publish
it. Without leaving the comfort of Flash, you can convert the editable .fla file
you’ve been working with into a noneditable .swf file and either embed it into
an HTML file or create a standalone projector file that your audience can run
without having to use a browser. Chapter 20 tells you everything you need to
know about publishing.
The scenario described above is pretty simple, but it covers the basic steps you need
to take when creating any Flash animation.
The Very Basics
You’ll find very little jargon or nerd terminology in this book. You will, however,
encounter a few terms and concepts that you’ll use frequently in your computing life:
• Clicking. This book gives you three kinds of instructions that require you to use
your computer’s mouse or trackpad. To click means to point the arrow cursor at
something on the screen and then—without moving the cursor at all—to press
and release the left clicker button on the mouse (or laptop trackpad). To double-
click, of course, means to click twice in rapid succession, again without moving
the cursor at all. And to drag means to move the cursor while pressing the left
button continuously.
• Keyboard shortcuts. Every time you take your hand off the keyboard to move
the mouse, you lose time and potentially disrupt your creative flow. That’s why

×