Macromedia FLASH MX User Manual

Using Flash
Trademarks
Add Life to the Web, Afterburner, Aftershock, Andromedia, Allaire, Animation PowerPack, Aria, Attain, Authorware, Authorware Star, Backstage, Bright Tiger, Clustercats, ColdFusion, Contribute, Design In Motion, Director, Dream Templates, Dreamweaver, Drumbeat 2000, EDJE, EJIPT, Extreme 3D, Fireworks, Flash, Flash Lite, Flex, Fontographer, FreeHand, Generator, HomeSite, JFusion, JRun, Kawa, Know Your Site, Knowledge Objects, Knowledge Stream, Knowledge Track, LikeMinds, Lingo, Live Effects, MacRecorder Logo and Design, Macromedia, Macromedia Action!, Macromedia Breeze, Macromedia Flash, Macromedia M Logo and Design, Macromedia Spectra, Macromedia xRes Logo and Design, MacroModel, Made with Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Open Sesame!, Roundtrip, Roundtrip HTML, Shockwave, Sitespring, SoundEdit, Titlemaker, UltraDev, Web Design 101, what the web can be, and Xtra are either registered trademarks or trademarks of Macromedia, Inc. and may be registered in the United States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases mentioned within this publication may be trademarks, service marks, or trade names of Macromedia, Inc. or other entities and may be registered in certain jurisdictions including internationally.
Third-Party Information
This guide contains links to third-party websites that are not under the control of Macromedia, and Macromedia is not responsible for the content on any linked site. If you access a third-party website mentioned in this guide, then you do so at your own risk. Macromedia provides these links only as a convenience, and the inclusion of the link does not imply that Macromedia endorses or accepts any responsibility for the content on those third-party sites.
Speech compression and decompression technology licensed from Nellymoser, Inc. (www.nellymoser.com).
Sorenson™ Spark™ video compression and decompression technology licensed from Sorenson Media, Inc.
Opera ® browser Copyright © 1995-2002 Opera Software ASA and its suppliers. All rights reserved.
Apple Disclaimer
APPLE COMPUTER, INC. MAKES NO WARRANTIES, EITHER EXPRESS OR IMPLIED, REGARDING THE ENCLOSED COMPUTER SOFTWARE PACKAGE, ITS MERCHANTABILITY OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. THE EXCLUSION OF IMPLIED WARRANTIES IS NOT PERMITTED BY SOME STATES. THE ABOVE EXCLUSION MAY NOT APPLY TO YOU. THIS WARRANTY PROVIDES YOU WITH SPECIFIC LEGAL RIGHTS. THERE MAY BE OTHER RIGHTS THAT YOU MAY HAVE WHICH VARY FROM STATE TO STATE.
Copyright © 2004 Macromedia, Inc. All rights reserved. This manual may not be copied, photocopied, reproduced, translated, or converted to any electronic or machine-readable form in whole or in part without prior written approval of Macromedia, Inc.
Acknowledgments
Director: Erick Vera
Project Management: Julee Burdekin, Erick Vera
Writing: Jay Armstrong, Jody Bleyle, Mary Burger, Francis Cheng, Jen deHaan, Stephanie Gowin, Phillip Heinz, Shimul Rahim, Samuel R. Neff
Managing Editor: Rosana Francescato
Editing: Mary Ferguson, Mary Kraemer, Noreen Maher, Antonio Padial, Lisa Stanziano, Anne Szabla
Production Management: Patrice O’Neill
Media Design and Production: Adam Barnett, Christopher Basmajian, Aaron Begley, John Francis
Second Edition: June 2004 Macromedia, Inc.
600 Townsend St. San Francisco, CA 94103

CONTENTS

CHAPTER 1: Working with Flash Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Creating or opening a document and setting properties. . . . . . . . . . . . . . . . . . . . . 12
Using document tabs for multiple documents (Windows only). . . . . . . . . . . . . . . 14
Saving Flash documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
About adding media content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
About creating motion and interactivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
About components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Using the library to manage media assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
About ActionScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Multiple Timelines and levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Nested movie clips. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Using absolute and relative target paths. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Working with scenes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Using the Movie Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Using Find and Replace. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Using the Undo, Redo, and Repeat menu commands . . . . . . . . . . . . . . . . . . . . . . 34
Using the History panel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Saving documents when you undo steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Automating tasks with the Commands menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
About customizing context menus in Flash documents . . . . . . . . . . . . . . . . . . . . . 39
About the links menu in Flash Player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Speeding up document display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Optimizing Flash documents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Testing document download performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Printing from the Flash authoring tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
CHAPTER 2: Working with Projects (Flash Professional Only) . . . . . . . . . . . . . . 45
Creating and managing projects (Flash Professional only) . . . . . . . . . . . . . . . . . . . 46
Using version control with projects (Flash Professional only). . . . . . . . . . . . . . . . . 49
Troubleshooting remote folder setup (Flash Professional only). . . . . . . . . . . . . . . . 51
3
CHAPTER 3: Using Symbols, Instances, and Library Assets . . . . . . . . . . . . . . . . 53
Types of symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
About controlling instances and symbols with ActionScript. . . . . . . . . . . . . . . . . . 55
Creating symbols. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Creating instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Creating buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Enabling, editing, and testing buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Editing symbols. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Changing instance properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Controlling instances with behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Breaking apart instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Getting information about instances on the Stage . . . . . . . . . . . . . . . . . . . . . . . . 67
Copying library assets between documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Using shared library assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Resolving conflicts between library assets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
CHAPTER 4: Working with Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Using the Stroke Color and Fill Color controls in the Tools panel. . . . . . . . . . . . . 76
Using the Stroke Color and Fill Color controls in the Property inspector . . . . . . . 76
Working with solid colors and gradient fills in the Color Mixer. . . . . . . . . . . . . . . 77
Modifying strokes with the Ink Bottle tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Applying solid, gradient, and bitmap fills with the Paint Bucket tool. . . . . . . . . . . 79
Transforming gradient and bitmap fills . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Copying strokes and fills with the Eyedropper tool . . . . . . . . . . . . . . . . . . . . . . . . 81
Locking a gradient or bitmap to fill the Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Modifying color palettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
CHAPTER 5: Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
About vector and bitmap graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Flash drawing and painting tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
About overlapping shapes in Flash. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Drawing with the Pencil tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Drawing straight lines, ovals, and rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Drawing polygons and stars. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Using the Pen tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Painting with the Brush tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Reshaping lines and shape outlines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Erasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Modifying shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Snapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Specifying drawing settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
4 Contents
CHAPTER 6: Working with Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
About Unicode text encoding in Flash applications. . . . . . . . . . . . . . . . . . . . . . . 107
About font outlines and device fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Creating text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Creating scrolling text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Setting text attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Creating font symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Editing text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Checking spelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
About transforming text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Using Timeline effects with text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Breaking text apart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Linking text to a URL (horizontal text only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Preserving rich text formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Substituting missing fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Controlling text with ActionScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Creating scrolling text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
CHAPTER 7: Using Imported Artwork. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Placing artwork into Flash. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Working with imported bitmaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
CHAPTER 8: Working with Graphic Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Selecting objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Grouping objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Moving, copying, and deleting objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Stacking objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Transforming objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Flipping objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Restoring transformed objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Aligning objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Breaking apart groups and objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
CHAPTER 9: Creating Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Using Timeline effects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Tweened animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Frame-by-frame animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Layers in animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Creating keyframes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Representations of animations in the Timeline . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Frame rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Extending still images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Distributing objects to layers for tweened animation . . . . . . . . . . . . . . . . . . . . . . 164
Tweening instances, groups, and type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Tweening motion along a path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Contents 5
Tweening shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Using shape hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Creating frame-by-frame animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Editing animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Using mask layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
CHAPTER 10: Working with Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
About file formats for imported video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
About the Sorenson Spark codec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Using the Video Import wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Importing Macromedia Flash Video (FLV) files. . . . . . . . . . . . . . . . . . . . . . . . . . 187
Importing linked QuickTime video files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
About playing back external FLV files dynamically . . . . . . . . . . . . . . . . . . . . . . . 189
Changing the properties of a video clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Controlling video playback using behaviors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
About controlling video playback using the Timeline . . . . . . . . . . . . . . . . . . . . . 192
Exporting FLV files from video-editing applications (Flash Professional only) . . . 192
Playing FLV video clips with media components (Flash Professional only) . . . . . 196
CHAPTER 11: Working with Sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Importing sounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Adding sounds to a document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Adding sounds to buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Using sounds with Sound objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
About accessing ID3 properties in MP3 files with Flash Player . . . . . . . . . . . . . . 205
Using the sound-editing controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Controlling sound playback using behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Starting and stopping sounds at keyframes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
About the onSoundComplete event. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Compressing sounds for export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Using sounds in Flash documents for mobile devices
(Flash Professional only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Creating a Flash Lite sound file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
CHAPTER 12: Working with Screens (Flash Professional Only) . . . . . . . . . . . . 215
Understanding screen-based documents and the
screen authoring environment (Flash Professional only) . . . . . . . . . . . . . . . . . 216
Using the Screen Outline pane (Flash Professional only) . . . . . . . . . . . . . . . . . . . 219
About undoing and redoing commands with screens
(Flash Professional only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Using the screens context menu (Flash Professional only) . . . . . . . . . . . . . . . . . . 220
Creating a new screen-based document (Flash Professional only). . . . . . . . . . . . . 220
Adding screens to a document (Flash Professional only) . . . . . . . . . . . . . . . . . . . 221
Naming screens (Flash Professional only). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Setting properties and parameters for a screen (Flash Professional only). . . . . . . . 223
About adding media content to screens (Flash Professional only). . . . . . . . . . . . . 226
6 Contents
Selecting and moving screens (Flash Professional only) . . . . . . . . . . . . . . . . . . . . 226
Creating controls and transitions for screens with behaviors
(Flash Professional only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Using Find and Replace with screens (Flash Professional only) . . . . . . . . . . . . . . 230
About using the Movie Explorer with screens (Flash Professional only) . . . . . . . . 230
About using Timelines with screens (Flash Professional only) . . . . . . . . . . . . . . . 231
About using ActionScript with screens (Flash Professional only) . . . . . . . . . . . . . 231
About using components with screens (Flash Professional only) . . . . . . . . . . . . . 233
Accessibility in the Flash screens authoring environment (Flash Professional only)233
CHAPTER 13: Creating Multilanguage Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Selecting an encoding language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Fonts for Unicode-encoded text. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Authoring multilanguage text with the Strings panel . . . . . . . . . . . . . . . . . . . . . . 240
Creating documents with multilanguage text without using the Strings panel . . . 248
Using external text or XML files that are not Unicode encoded. . . . . . . . . . . . . . 251
CHAPTER 14: Data Integration (Flash Professional Only) . . . . . . . . . . . . . . . . . 253
Additional resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Creating a simple application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Workflows for using the data components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Data binding (Flash Professional only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Data connectivity (Flash Professional only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Data management (Flash Professional only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Data resolution (Flash Professional only). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Advanced topics in data integration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
CHAPTER 15: Publishing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Playing your Flash SWF files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
About publishing secure Flash documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Publishing Flash documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
About publishing Flash Lite documents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Using publish profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
About HTML publishing templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Customizing HTML publishing templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Editing Flash HTML settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Previewing the publishing format and settings. . . . . . . . . . . . . . . . . . . . . . . . . . . 342
Using Flash Player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
About configuring a web server for Flash. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
CHAPTER 16: Exporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Exporting Flash content and images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
About export file formats. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
Updating Flash content for Dreamweaver UltraDev . . . . . . . . . . . . . . . . . . . . . . 352
Contents 7
CHAPTER 17: Creating Accessible Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Worldwide accessibility standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
Macromedia Flash Accessibility web page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
Understanding screen reader technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
Using Flash to enter accessibility information for screen readers . . . . . . . . . . . . . 359
Viewing and creating tab order and reading order . . . . . . . . . . . . . . . . . . . . . . . . 366
Creating a tab order index for keyboard navigation in the Accessibility panel (Flash
Professional only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
About animation and accessibility for the visually impaired. . . . . . . . . . . . . . . . . 368
Using accessible components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Creating accessibility with ActionScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Accessibility for hearing-impaired users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
Testing accessible content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
CHAPTER 18: Printing from SWF Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Controlling printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Supported printers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Using the ActionScript PrintJob class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Building a print job. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Starting a print job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
Printing frames independent of the PrintJob class . . . . . . . . . . . . . . . . . . . . . . . . 381
Changing the printed background color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
Using frame labels to disable printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
Printing from the Flash Player context menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Publishing a document with printable frames . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
CHAPTER 19: Creating E-learning Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Getting started with Flash learning interactions. . . . . . . . . . . . . . . . . . . . . . . . . . 388
About Flash learning interactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
Including a Flash learning interaction in a document . . . . . . . . . . . . . . . . . . . . . 389
Changing the appearance of a learning interaction . . . . . . . . . . . . . . . . . . . . . . . 398
Testing a quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Configuring learning interactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Adding, naming, and registering assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Setting feedback options for a learning interaction . . . . . . . . . . . . . . . . . . . . . . . 411
Setting Knowledge Track options for a learning interaction. . . . . . . . . . . . . . . . . 412
Setting navigation options for a learning interaction . . . . . . . . . . . . . . . . . . . . . . 413
Setting control button labels for a learning interaction . . . . . . . . . . . . . . . . . . . . 414
Tracking to AICC- or SCORM-compliant learning management systems . . . . . . 414
Extending learning interaction scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
APPENDIX A: Using Samples and Templates . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Using samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Using templates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
8 Contents
APPENDIX B: XML to UI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Layout tag summary for XML to UI dialog boxes . . . . . . . . . . . . . . . . . . . . . . . . 435
Control tag summary for XML to UI dialog boxes . . . . . . . . . . . . . . . . . . . . . . . 436
<column> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
<columns> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
<dialog> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
<grid> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
<hbox> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
<row> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
<rows> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
<separator> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
<spacer> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
<vbox> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
<button> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
<checkbox> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
<choosefile> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
<colorchip> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
<flash> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
<label> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
<listbox> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
<listitem> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
<menulist> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
<menupop>. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
<menuitem> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
<popupslider> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
<property> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
<radiogroup>. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
<radio> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
<targetlist> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
<textbox> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
Contents 9
10 Contents
CHAPTER 1

Working with Flash Documents

When you create and save Macromedia Flash MX 2004 and Macromedia Flash MX Professional
2004 documents within the Flash authoring environment, the documents are in FLA file format.
To display a document in Macromedia Flash Player, you must publish or export the document
as a SWF file.
Note: For information on publishing or exporting a file, see Chapter 15, “Publishing,” on page 309 or
Chapter 16, “Exporting,” on page 345.
You can add media assets to a Flash document and manage the assets in the library, and you can
use the Movie Explorer to view and organize all the elements in a Flash document. The Undo
and Redo commands, the History panel, and the Commands menu let you automate tasks in
a document.
This chapter contains the following sections:
Creating or opening a document and setting properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Using document tabs for multiple documents (Windows only) . . . . . . . . . . . . . . . . . . . . . . . . 14
Saving Flash documents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
About adding media content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
About creating motion and interactivity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
About components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Using the library to manage media assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
About ActionScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Multiple Timelines and levels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Nested movie clips. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Using absolute and relative target paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Working with scenes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Using the Movie Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Using Find and Replace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
11
Using the Undo, Redo, and Repeat menu commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Using the History panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Saving documents when you undo steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Automating tasks with the Commands menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
About customizing context menus in Flash documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
About the links menu in Flash Player. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Speeding up document display. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Optimizing Flash documents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Testing document download performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Printing from the Flash authoring tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

Creating or opening a document and setting properties

You can create a new document or open a previously saved document as you work in Flash. In
Windows, you can use the New File button to open a document of the same type as the last
document created.
To set the size, frame rate, background color, and other properties of a new or existing document,
you use the Document Properties dialog box. You can also use the Property inspector to set
properties for an existing document. The Property inspector makes it easy to access and change
the most commonly used attributes of a document. For more information on the Property
inspector, see “Using panels and the Property inspector” in Getting Started with Flash.
You can open a Flash template as a new document. You can select from standard templates that
come with Flash or open a template you have already saved. For information on saving a
document file as a template, see “Saving Flash documents” on page 14.
In the On Launch section of the Preferences dialog box, you can select an option to specify what
document Flash opens when you start the application: You select New Document to open a new,
blank document, Last Documents Open to open the documents that were open when you last
quit Flash, or No Document to start Flash without opening a document. For more information,
see “Setting preferences in Flash” in Getting Started with Flash.
For information on creating a new document using the Start page, see “Using the Start page” in
Getting Started with Flash.
You can open a new window as you work.
To create a new document:
1.
Select File > New.
2.
On the General tab, select Flash Document.
To create a new document with the New File button (Windows only):
Click the New File button in the main toolbar to create a new document of the same type as
the last document created.
12 Chapter 1: Working with Flash Documents
To open an existing document:
1.
Select File > Open.
2.
In the Open dialog box, navigate to the file or enter the path to the file in the Go To text box.
3.
Click Open.
To set properties for a new or existing document in the Document Properties dialog box:
1.
With the document open, select Modify > Document.
The Document Properties dialog box appears.
2.
For Frame Rate, enter the number of animation frames to appear every second. For most computer-displayed animations, especially those playing from a website, 8 frames per second (fps) to 12 fps is sufficient (12 fps is the default frame rate).
3.
For Dimensions, do one of the following:
To specify the Stage size in pixels, enter values in the Width and Height text boxes.
The default document size is 550 x 400 pixels. The minimum size is 1 x 1 pixels; the maximum is 2880 x 2880 pixels.
To set the Stage size so that there is equal space around the content on all sides, click the
Contents button to the right of Match. To minimize document size, align all elements to the upper left corner of the Stage, and then click Contents.
To set the Stage size to the maximum available print area, click Printer. This area is
determined by the paper size minus the current margin selected in the Margins area of the Page Setup dialog box (Windows) or the Print Margins dialog box (Macintosh).
To set the Stage size to the default size, click Default.
4.
To set the background color of your document, click the triangle in the Background Color box and select a color from the palette.
5.
To specify the unit of measure for rulers that you can display along the top and side of the application window, select an option from the pop-up menu in the upper right. For more information, see “Using the grid, guides, and rulers” in Getting Started with Flash.(This setting also determines the units used in the Info panel.)
6.
Do one of the following:
To make the new settings the default properties for your new document only, click OK.
To make the new settings the default properties for all new documents, click Make Default.
To create a new document from a template:
1.
Select File > New.
2.
Click the Templates tab.
3.
Select a category from the Category list, and select a document from the Category Items list.
4.
Click OK.
To open a new window in the current document:
Select Window > New Window.
Creating or opening a document and setting properties 13
To change document properties with the Property inspector:
1.
Deselect all assets, then select the Selection tool.
2.
If the Property inspector is not visible, select Window > Properties.
3.
Click the Size control to display the Document Properties dialog box and access its settings.
4.
To select a background color, click the triangle in the Background color box and select a color from the palette.
5.
For Frame Rate, enter the number of animation frames to appear every second.
6.
For Publish, click the Settings button to display the Publish Settings dialog box with the Flash tab selected. For more information on the Publish Settings dialog box, see “Publishing Flash
documents” on page 311.

Using document tabs for multiple documents (Windows only)

When you open multiple documents in Windows, tabs at the top of the Document window
identify the open documents and let you easily navigate among them. Tabs appear only when
documents are maximized in the Document window.
To make a document active, you click its tab. By default, tabs appear in the order in which the
documents were created. You cannot drag tabs to change their order.
To view a document when multiple documents are open:
Click the document tab.

Saving Flash documents

You can save a Flash FLA document using its current name and location or save the document
using a different name or location. You can revert to the last saved version of a document. You can
also save Flash MX 2004 content as a Flash MX document.
When a document contains unsaved changes, an asterisk (*) appears after the document name in
the document title bar, the application title bar, and the document tab (Windows only). When
you save the document, the asterisk is removed.
You can save a document as a template, which lets you use the document as the starting point for
a new Flash document (this is similar to how you would use templates in word-processing or web
page–editing applications). For information on using templates to create new documents, see
“Creating or opening a document and setting properties” on page 12.
When you save a document using the Save command, Flash performs a quick save, which
appends new information to the existing file. When you save using the Save As command, Flash
arranges the new information into the file, creating a smaller file on disk.
If you quit Flash while one or more documents with unsaved changes are open, Flash prompts
you to save the document or documents with the changes.
When you delete items from a document by undoing commands, you can permanently remove
the items from the document and reduce the document file size, using the
File > Save and Compact command. See “Saving documents when you undo steps” on page 37.
14 Chapter 1: Working with Flash Documents
To save a Flash document:
1.
Do one of the following:
To overwrite the current version on the disk, select File > Save.
To save the document in a different location and/or with a different name, or to compress
the document, select File > Save As.
2.
If you selected the Save As command, or if the document has never been saved before, enter the filename and location.
3.
Click Save.
To revert to the last saved version of a document:
Select File > Revert.
To save a document as a template:
1.
Select File > Save As Template.
2.
In the Save As Template dialog box, enter a name for the template in the Name text box.
3.
Select a category from the Category pop-up menu, or enter a name to create a new category.
4.
Enter a description of the template in the Description text box (as many as 255 characters). The description appears when the template is selected in the New Document dialog box.
5.
Click OK.
To save a document as a Flash MX document:
1.
Select File > Save As.
2.
Enter the filename and location.
3.
Select Flash MX Document from the Format pop-up menu. If an alert message indicates that content will be deleted if you save in Flash MX format, click Save As Flash MX to continue. This might happen if your document contains features, such as behaviors, that are available only in Flash MX 2004. These features will not be preserved when you save the document in Flash MX format.
4.
Click Save.
To save documents when quitting Flash:
1.
Select File > Exit (Windows) or Flash > Quit Flash (Macintosh).
2.
If you have documents open with unsaved changes, Flash prompts you to save or discard the changes for each document.
Click Yes to save the changes and close the document.
Click No to close the document without saving the changes.
Saving Flash documents 15

About adding media content

You can add media content to a Flash document in the Flash authoring environment. You can
create vector artwork or text directly in Flash; import vector artwork, bitmaps, video, and sound;
and create symbols, reusable media content such as buttons.
You can also use ActionScript to add media content to a document dynamically. For more
information on ActionScript, see Chapter 2, “ActionScript Basics,” in Using ActionScript in Flash.
Media content that you add in the authoring environment includes the following:
Vector artwork You can create vector artwork with the Flash drawing and painting tools or
import artwork from another application. See Chapter 5, “Drawing,” on page 85 and Chapter 7,
“Using Imported Artwork,” on page 131.
Text You can create static text, text whose contents and appearance you determine when you
author the document. You can also create dynamic text fields, which display text that updates
dynamically during runtime, and input text fields, which let users enter text for forms or other
purposes. See Chapter 6, “Working with Text,” on page 105.
Bitmaps You can import bitmaps from other applications, use a bitmap as a file, convert the
bitmap to vector artwork, and modify it in other ways. See Chapter 7, “Using Imported
Artwork,” on page 131.
Video You can import video clips from other applications as embedded or linked files, and
select compression and editing options. See Chapter 10, “Working with Video,” on page 177.
Sound You can import sound files from other applications and use them as event sounds or
streaming sounds in a document. See Chapter 11, “Working with Sound,” on page 201.
Symbols You can use symbols, objects that you create once and reuse multiple times. Symbols
can be movie clips, buttons, or graphics. Each symbol has its own Timeline. See Chapter 3,
“Using Symbols, Instances, and Library Assets,” on page 53.

About creating motion and interactivity

Flash provides several ways for you to easily add motion and interactivity to your documents,
which creates a compelling user experience. For example, you can make visual elements, such as
text, graphics, buttons, or movie clips, move or disappear; you can link to another URL; and you
can load another document or movie clip into the current document. The following features let
you add motion and interactivity:
Timeline effects are prebuilt animations that you can apply to text, graphics, bitmaps, and
buttons, to add motion to visual elements with little effort. See “Using Timeline effects”
on page 158.
Tweened and frame-by-frame animation is motion that you create by placing graphics on
frames in the Timeline. In tweened animation, you create the beginning and ending frames of the
animation, and Flash creates the intermediary frames. In frame-by-frame animation, you create
graphics for each frame in the animation. See “Tweened animation” on page 161 and “Frame-by-
frame animation” on page 162.
16 Chapter 1: Working with Flash Documents
Behaviors are prewritten ActionScript scripts that you add to an object to control that object.
Behaviors let you add the power, control, and flexibility of ActionScript coding to your document
without having to create the ActionScript code. You can use behaviors to control movie clips and
video and sound files. See the following sections:
“Controlling instances with behaviors” on page 65.
“Controlling video playback using behaviors” on page 191.
“Controlling sound playback using behaviors” on page 206.
In screen-based documents, you can use behaviors to control screens. See “Creating controls and
transitions for screens with behaviors (Flash Professional only)” on page 228.
Note: You can use ActionScript to create complex or customized interactivity. See Chapter 2,
“ActionScript Basics,” in Using ActionScript in Flash.

About components

Components are movie clips with parameters that let you modify their appearance and behavior.
A component can provide a wide range of functionality. A component can be a simple user
interface control, such as a radio button or a check box, or it can be a complicated control
element, such as a media controller or a scroll pane. A component can even be nonvisual, such as
the focus manager that lets you control which object receives focus in an application.
Components let you separate coding and design. They also let you reuse code, and download
components created by other developers. For more information, see “Getting Started with
Components” in Using Components.

Using the library to manage media assets

The library in a Flash document stores media assets that you create or import for use in a Flash
document. The library stores imported files such as video clips, sound clips, bitmaps, and
imported vector artwork as well as symbols. A symbol is a graphic, button, or movie clip that you
create once and can reuse multiple times. You can also create a font symbol. For information on
symbols, see Chapter 3, “Using Symbols, Instances, and Library Assets,” on page 53 and
“Creating font symbols” on page 116.
The library also contains components that you have added to your document. Components
appear in the library as compiled clips. For more information, see “Components in the Library
panel” in Using Components.
The Library panel displays a scroll list with the names of all items in the library, which lets you
view and organize these elements as you work. An icon next to an item’s name in the Library
panel indicates the item’s file type. The Library panel has an options menu with commands for
managing library items.
You can open the library of any Flash document while you are working in Flash, to make the
library items from that file available for the current document.
Using the library to manage media assets 17
You can create permanent libraries in your Flash application that is available whenever you start
Flash. Flash also includes several sample libraries containing buttons, graphics, movie clips, and
sounds that you can add to your Flash documents. The sample Flash libraries and permanent
libraries that you create are listed in the Window > Common Libraries submenu. For more
information, see “Working with common libraries” on page 21.
You can export library assets as a SWF file to a URL to create a runtime-shared library. This lets
you link to the library assets from Flash documents that import symbols using runtime sharing.
For more information, see “Using shared library assets” on page 69.
To display the Library panel:
Select Window > Library.
To open the library from another Flash file:
1.
Select File > Import > Open External Library.
2.
Navigate to the Flash file whose library you want to open and click Open.
The selected file’s library opens in the current document, with the filename at the top of the Library panel. To use items from the selected file’s library in the current document, drag the items to the current document’s Library panel or to the Stage.
To resize the Library panel:
Drag the lower right corner of the panel.
Click the Wide State button to enlarge the Library panel so it shows all the columns.
Click the Narrow State button to reduce the width of the Library panel.
To change the width of columns:
Position the pointer between column headers and drag to resize.
You cannot change the order of columns.
To use the Library options menu:
1.
Click the options menu button in the Library panel’s title bar to view the options menu.
2.
Click an item in the menu.

Working with library items

When you select an item in the Library panel, a thumbnail preview of the item appears at the
top of the Library panel. If the selected item is animated or is a sound file, you can use the Play
button in the library preview window or the Controller to preview the item. You can use
folders in the library to organize library items. See “Working with folders in the Library panel”
on page 19.
To use a library item in the current document:
Drag the item from the Library panel onto the Stage.
The item is added to the current layer.
18 Chapter 1: Working with Flash Documents
To convert an object to a symbol in the library:
Drag the item from the Stage onto the current Library panel.
To use a library item from the current document in another document:
Drag the item from the library or Stage into the library or Stage for another document.

Working with folders in the Library panel

You can organize items in the Library panel using folders, much like in the Windows Explorer or
the Macintosh Finder. When you create a new symbol, it is stored in the selected folder. If no
folder is selected, the symbol is stored at the root of the library.
To create a new folder:
Click the New Folder button at the bottom of the Library panel.
To open or close a folder:
Double-click the folder.
Select the folder and select Expand Folder or Collapse Folder from the Library options menu.
To open or close all folders:
Select Expand All Folders or Collapse All Folders from the Library options menu.
To move an item between folders:
Drag the item from one folder to another. If an item with the same name exists in the new
location, Flash prompts you to replace the item you are moving.

Sorting items in the Library panel

Columns in the Library panel list the name of an item, its type, the number of times it’s used in
the file, its linkage status and identifier (if the item is associated with a shared library or is
exported for ActionScript), and the date on which it was last modified.
You can sort items in the Library panel alphanumerically by any column. Sorting items lets you
view related items together. Items are sorted within folders.
To sort items in the Library panel:
Click the column header to sort by that column. Click the triangle button to the right of the
column headers to reverse the sort order.

Editing items in the library

To edit library items, including imported files, you select options from the Library options menu.
You can also update imported files after editing them in an external editor, using the Update
option in the Library options menu. For more information, see “Updating imported files in the
Library panel” on page 21.
Using the library to manage media assets 19
To edit a library item:
1.
Select the item in the Library panel.
2.
Select one of the following from the Library options menu:
Select Edit to edit an item in Flash.
Select Edit With and then select an external application to edit the item.
Note: When starting a supported external editor, Flash opens the original imported document.

Renaming library items

You can rename items in the library. Changing the library item name of an imported file does not
change the filename.
To rename a library item:
Double-click the item’s name and enter the new name in the text box.
Select the item and select Rename from the Library options menu, and then enter the new
name in the text box.
Right-click (Windows) or Control-click (Macintosh) the item and select Rename from the
context menu, and then enter the new name in the text box.

Deleting library items

When you delete an item from the library, all instances or occurrences of that item in the
document are also deleted. The Use Count column in the Library panel indicates whether an
item is in use.
To delete a library item:
1.
Select the item and click the trash can icon at the bottom of the Library panel.
2.
In the warning box that appears, select Delete Symbol Instances (the default) to delete the library item and all its instances. Deselect the option to delete only the symbol, which leaves the instances on the Stage.
3.
Click Delete.

Finding unused library items

To make organizing a document easier, you can locate unused library items and delete them.
Note: It is not necessary to delete unused library items to reduce a Flash document’s file size because
unused library items are not included in the SWF file. However, items linked for export are included in
the SWF file. For more information, see “Using shared library assets” on page 69.
To find unused library items:
Select Unused Items from the Library options menu.
Sort library items by the Use Count column. See “Sorting items in the Library panel”
on page 19.
20 Chapter 1: Working with Flash Documents

Updating imported files in the Library panel

If you use an external editor to modify files that you have imported into Flash, such as bitmaps or
sound files, you can update the files in Flash without reimporting them. You can also update
symbols that you have imported from external Flash documents. Updating an imported file
replaces its contents with the contents of the external file.
To update an imported file:
Select the imported file in the Library panel and select Update from the Library options menu.

Working with common libraries

You can use the sample common libraries included with Flash to add buttons or sounds to your
documents. You can also create custom common libraries, which you can then use with any
documents that you create.
To use an item from a common library in a document:
1.
Select Window > Other Panels > Common Libraries, and select a library from the submenu.
2.
Drag an item from the common library into the library for the current document.
To create a common library for your Flash application:
1.
Create a Flash file with a library containing the symbols that you want to include in the permanent library.
2.
Place the Flash file in the Libraries folder located in the Flash application folder on your hard disk.
Note: The Libraries folder is located in the application-level configuration folder, one of several
configuration folders placed on your hard drive when you install Flash. For the location of
configuration folders, see “Configuration folders installed with Flash” on page 17.

About ActionScript

ActionScript is the Flash scripting language that lets you add complex interactivity, playback
control, and data display to a Flash document. You can add ActionScript within the Flash
authoring environment using the Actions panel or create external ActionScript files using an
external editor.
You don’t need to understand every ActionScript element to begin scripting; if you have a clear
goal, you can start building scripts with simple actions. You can incorporate new elements of the
language as you learn them to accomplish more complicated tasks.
As with other scripting languages, ActionScript follows its own rules of syntax, reserves keywords,
provides operators, and lets you use variables to store and retrieve information.
ActionScript includes built-in objects and functions and lets you create custom
objects and functions. For more information on ActionScript, see Chapter 2, “ActionScript
Basics,” in Using ActionScript in Flash.
About ActionScript 21
ActionScript is based on the ECMAscript specification (ECMA-262), the international standard
for the ECMAscript programming language. ActionScript offers a subset of ECMAscript’s
functionality. For more information about ECMAscript, see the ECMA International website at
www.ecma-international.org.
The popular JavaScript language is rooted in the same standard. For this reason, developers who
are familiar with JavaScript should find ActionScript immediately familiar and have no trouble
learning it quickly.

Multiple Timelines and levels

Flash Player has a stacking order of levels. Every Flash document has a main Timeline located at
level 0 in Flash Player. You can use the
files) into Flash Player at different levels. For more information, see
ActionScript Language Reference.
If you load documents into levels above level 0, the documents stack on top of one another like
drawings on transparent paper; when there is no content on the Stage, you can see through to the
content on lower levels. If you load a document into level 0, it replaces the main Timeline. Each
document loaded into a level of Flash Player has its own Timeline.
When you add a movie clip instance to a document, the movie clip Timeline is nested inside the
main Timeline of the document. You can also nest a movie clip inside another movie clip. For
more information, see “Nested movie clips” on page 22.
You can use ActionScript to send a message from one Timeline to another. You must use a target
path to specify the location of the Timeline to which you are sending the message. For more
information, see “Using absolute and relative target paths” on page 23.
loadMovie action to load other Flash documents (SWF
loadMovie() in Flash

Nested movie clips

Flash documents can have movie clip instances in their Timelines. Each movie clip instance has
its own Timeline. You can place a movie clip instance inside another movie clip instance.
Note: A movie clip is a type of symbol. For information on adding movie clips to a document, see
Chapter 3, “Using Symbols, Instances, and Library Assets,” on page 53.
A movie clip nested inside another movie clip (or inside a document) is a child of that movie clip
or document. Relationships between nested movie clips are hierarchical: modifications made to
the parent will affect the child. You can use ActionScript to send messages between movie clips
and their Timelines. To control a movie clip Timeline from another Timeline, you must specify
the location of the movie clip with a target path. In the Movie Explorer, you can view the
hierarchy of nested movie clips in a document.
You can also use behaviors, which are ActionScript scripts, to control movie clips. For more
information, see “Controlling instances with behaviors” on page 65.
22 Chapter 1: Working with Flash Documents

Parent and child movie clips

When you place a movie clip instance on another movie clip’s Timeline, the placed movie clip is
the child and the other movie clip is the parent. The parent instance contains the child instance.
The root Timeline for each level is the parent of all the movie clips on its level, and because it is
the topmost Timeline, it has no parent.
A child Timeline nested inside another Timeline is affected by changes made to the parent
Timeline. For example, if
oregon, then the scale of portland also changes.
portland is a child of oregon and you change the _xscale property of
Timelines can send messages to each other with ActionScript. For example, an action on the last
frame of one movie clip can tell another movie clip to play. To use ActionScript to control a
Timeline, you must use a target path to specify the location of the Timeline. For more
information, see “Writing target paths” on page 25.

Movie clip hierarchy

The parent-child relationships of movie clips are hierarchical. To understand this hierarchy,
consider the hierarchy on a computer: the hard disk has a root directory (or folder) and
subdirectories. The root directory is analogous to the main Timeline of a Flash document: it is
the parent of everything else. The subdirectories are analogous to movie clips.
You can use the movie clip hierarchy in Flash to organize related objects. Any change you make to
a parent movie clip also affects its children.
For example, you could create a Flash document containing a car that moves across the Stage.
You can use a movie clip symbol to represent the car and set up a motion tween to move it across
the Stage.
To add wheels that rotate, you can create a movie clip for a car wheel, and create two instances of
this movie clip, named
movie clip’s Timeline—not on the main Timeline. As children of
backWheel are affected by any changes made to car; they move with the car as it tweens across
frontWheel and backWheel. Then you can place the wheels on the car
car, frontWheel and
the Stage.
To make both wheel instances spin, you can set up a motion tween that rotates the wheel symbol.
Even after you change
their parent movie clip,
frontWheel and backWheel, they continue to be affected by the tween on
car; the wheels spin, but they also move with the parent movie clip car
across the Stage.

Using absolute and relative target paths

You can use ActionScript to send messages from one Timeline to another. The Timeline that
contains the action is called the controlling Timeline, and the Timeline that receives the action is
called the target Timeline. For example, there could be an action on the last frame of one Timeline
that tells another Timeline to play. To refer to a target Timeline, you must use a target path,
which indicates the location of a movie clip in the display list.
Using absolute and relative target paths 23
The following example shows the hierarchy of a document named westCoast on level 0, which
contains three movie clips: california, oregon, and washington. Each of these movie clips in turn
contains two movie clips.
_level0
westCoast
california
sanfrancisco bakersfield
oregon
portland ashland
washington
olympia ellensburg
As on a web server, each Timeline in Flash can be addressed in two ways: with an absolute path or
with a relative path. The absolute path of an instance is always a full path from a level name,
regardless of which Timeline calls the action; for example, the absolute path to the instance
california is _level0.westCoast.california. A relative path is different when called from
different locations; for example, the relative path to
_parent
, but from portland, it’s _parent._parent.california.
california from sanfrancisco is

Absolute paths

An absolute path starts with the name of the level into which the document is loaded and
continues through the display list until it reaches the target instance. You can also use the alias
_root to refer to the topmost Timeline of the current level. For example, an action in the movie
clip
california that refers to the movie clip oregon could use the absolute path
_root.westCoast.oregon.
The first document to open in Flash Player is loaded at level 0. You must assign each additional
loaded document a level number. When you use an absolute reference in ActionScript to
reference a loaded document, use the form
_levelX, where X is the level number into which the
document is loaded. For example, the first document that opens in Flash Player is called
a document loaded into level 3 is called
_level3.
To communicate between documents on different levels, you must use the level name in the
target path. The following example shows how the
instance located on a movie clip called
_level5.georgia.atlanta
georgia (georgia is at the same level as oregon):
portland instance would address the atlanta
You can use the alias _root to refer to the main Timeline of the current level. For the main
Timeline, the
a document loaded into
on level 5. For example, if the movie clips
same level, an action called from the instance
path to target the instance
_root.eastCoast.florida
24 Chapter 1: Working with Flash Documents
_root alias stands for _level0 when targeted by a movie clip also on _level0. For
_level5, _root is equal to _level5 when targeted by a movie clip also
southcarolina and florida are both loaded into the
southcarolina could use the following absolute
florida:
_level0;

Relative paths

A relative path depends on the relationship between the controlling Timeline and the target
Timeline. Relative paths can address targets only within their own level of Flash Player.
For example, you can’t use a relative path in an action on
on
_level5.
_level0 that targets a Timeline
In a relative path, use the keyword
the alias
_parent alias repeatedly to go up one level in the movie clip hierarchy within the same level of
Flash Player. For example,
_parent to indicate the parent Timeline of the current Timeline. You can use the
_parent._parent controls a movie clip up two levels in the hierarchy.
The topmost Timeline at any level in Flash Player is the only Timeline with a
this to refer to the current Timeline in the current level; use
_parent value that
is undefined.
An action in the Timeline of the instance
could use the following target path to target the instance
_parent
charleston, located one level below southcarolina,
southcarolina:
To target the instance eastCoast (one level up) from an action in charleston, you could use
the following relative path:
_parent._parent
To target the instance atlanta from an action in the Timeline of charleston, you could use the
following relative path:
_parent._parent.georgia.atlanta
Relative paths are useful for reusing scripts. For example, you could attach the following script to
a movie clip that magnifies its parent by 150%:
onClipEvent (load) {
_parent._xscale = 150; _parent._yscale = 150;
}
You can reuse this script by attaching it to any movie clip instance.
Whether you use an absolute or a relative path, you identify a variable in a Timeline or a property
of an object with a dot (
following statement sets the variable
_root.form.name = "Gilbert";
.) followed by the name of the variable or property. For example, the
name in the instance form to the value "Gilbert":

Writing target paths

To control a movie clip, loaded movie, or button, you must specify a target path. In order to
specify a target path for a movie clip or button, you must assign an instance name to the movie
clip or button. A loaded document doesn’t require an instance name because you use its level
number as an instance name (for example,
_level5).
Using absolute and relative target paths 25
To specify a target path:
Use the Insert Target Path button (and dialog box) in the Actions panel.
Enter the target path manually.
Create an expression that evaluates to a target path. You can use the built-in functions
targetPath and eval.
To assign an instance name:
1.
Select a movie clip or button on the Stage.
2.
Enter an instance name in the Property inspector.
To insert a target path using the Insert Target Path dialog box:
1.
Select the movie clip, frame, or button instance to which you want to assign the action.
This becomes the controlling Timeline.
2.
Select Window > Development Panels > Actions to display the Actions panel if it’s not already open.
3.
In the Actions toolbox (at the left of the panel), select an action or method that requires a target path.
4.
Click the parameter box or location in the script where you want to insert the target path.
5.
Click the Insert Target Path button above the Script pane.
6.
In the Insert Target Path dialog box, select a syntax: Dots (the default) or Slashes.
7.
Select Absolute or Relative for the target path mode.
For more information, see “Using absolute and relative target paths” on page 23.
8.
Select a movie clip in the Insert Target Path display list.
9.
Click OK.
To insert a target path manually:
Follow steps 1–4 and enter an absolute or relative target path in the Actions panel.
To use an expression as a target path:
1.
Follow steps 1–3.
2.
Do one of the following:
Enter an expression that evaluates to a target path in a parameter box.
Click to place the insertion point in the script. Then, in the Functions category of the
Actions toolbox, double-click the
The
targetPath function converts a reference to a movie clip into a string.
Click to place the insertion point in the script. Then, in the Functions category of the
Actions toolbox, select the
The
eval function converts a string to a movie clip reference that can be used to call methods
such as
play.
26 Chapter 1: Working with Flash Documents
targetPath function.
eval function.
The following script assigns the value 1 to the variable i. It then uses the eval function to create a reference to a movie clip instance and assigns it to the variable
x. The variable x is
now a reference to a movie clip instance and can call the MovieClip object methods.
i = 1; x = eval("mc"+i); x.play(); // this is equivalent to mc1.play();
You can also use the eval function to call methods directly, as shown in the following example:
eval("mc" + i).play();

Working with scenes

To organize a document thematically, you can use scenes. For example, you might use separate
scenes for an introduction, a loading message, and credits.
Note: You cannot use scenes in a screen-based document. For information on screens, see
Chapter 12, “Working with Screens (Flash Professional Only),” on page 215.
When you publish a Flash document that contains more than one scene, the scenes in the
document play back in the order they are listed in the Scene panel in the Flash document. Frames
in the document are numbered consecutively through scenes. For example, if a document
contains two scenes with ten frames each, the frames in Scene 2 are numbered 11–20.
You can add, delete, duplicate, rename, and change the order of scenes.
To stop or pause a document after each scene, or to let users navigate the document
in a nonlinear fashion, you use actions. For more information, see Chapter 2, “ActionScript
Basics,” in Using ActionScript in Flash.
To display the Scene panel:
Select Window > Design Panels > Scene.
To view a particular scene:
Select View > Go To and then select the name of the scene from the submenu.
To add a scene:
Click the Add Scene button in the Scene panel.
Select Insert > Scene.
To delete a scene:
Click the Delete Scene button in the Scene panel.
To change the name of a scene:
Double-click the scene name in the Scene panel and enter the new name.
To duplicate a scene:
Click the Duplicate Scene button in the Scene panel.
Working with scenes 27
To change the order of a scene in the document:
Drag the scene name to a different location in the Scene panel.

Using the Movie Explorer

The Movie Explorer provides an easy way for you to view and organize the contents of a
document and select elements in the document for modification. It contains a display list of
currently used elements, arranged in a navigable hierarchical tree. You can filter which categories
of items in the document appear in the Movie Explorer, selecting from text, graphics, buttons,
movie clips, actions, and imported files. You can display the selected categories as scenes, symbol
definitions, or both. And you can expand and collapse the navigation tree.
The Movie Explorer offers many features to streamline the workflow for creating documents. For
example, you can use the Movie Explorer to do the following actions:
Search for an element in a document by name.
Familiarize yourself with the structure of a Flash document created by another developer.
Find all the instances of a particular symbol or action.
Print the navigable display list that appears in the Movie Explorer.
The Movie Explorer has an options menu as well as a context menu with options for performing
operations on selected items or modifying the Movie Explorer display. The options menu is
indicated by a check mark with a triangle below it in the title bar of the Movie Explorer.
Note: The Movie Explorer has slightly different functionality when you are working with screens. For
more information, see Chapter 12, “Working with Screens (Flash Professional Only),” on page 215.
To view the Movie Explorer:
Select Window > Other Panels > Movie Explorer.
To filter the categories of items appearing in the Movie Explorer:
To show text, symbols, ActionScript, imported files, or frames and layers, click one or more of
the filtering buttons to the right of the Show option. To customize which items to show, click the Customize button. Select options in the Show area of the Movie Explorer Settings dialog box to view those elements.
From the options menu in Movie Explorer, select Show Movie Elements to show items
in scenes.
From the options menu in Movie Explorer, select Show Symbol Definitions to show
information about symbols.
Note: Both the Movie Elements option and the Symbol Definitions option can be active at the same time.
To search for an item using the Find text box:
In the Find text box, enter the item name, font name, ActionScript string, or frame number.
The Find feature searches all items that appear in the Movie Explorer.
28 Chapter 1: Working with Flash Documents
To select an item in the Movie Explorer:
Click the item in the navigation tree. Shift-click to select more than one item.
The full path for the selected item appears at the bottom of the Movie Explorer. Selecting a scene in the Movie Explorer shows the first frame of that scene on the Stage. Selecting an element in the Movie Explorer selects that element on the Stage if the layer containing the element is not locked.
To use the Movie Explorer options menu or context menu commands:
1.
Do one of the following:
To view the options menu, click the options menu control in the Movie Explorer’s title bar.
To view the context menu, right-click (Windows) or Control-click (Macintosh) an item in
the Movie Explorer navigation tree.
2.
Select an option from the menu:
Go to Location jumps to the selected layer, scene, or frame in the document.
Go to Symbol Definition jumps to the symbol definition for a symbol that is selected in the
Movie Elements area of the Movie Explorer. The symbol definition lists all the files associated with the symbol. (The Show Symbol Definitions option must be selected. See its definition in this list.)
Select Symbol Instances jumps to the scene containing instances of a symbol that is selected
in the Symbol Definitions area of the Movie Explorer. (The Show Movie Elements option must be selected.)
Find in Library highlights the selected symbol in the document’s library (Flash opens the
Library panel if it is not already visible).
Rename lets you enter a new name for a selected element.
Edit in Place lets you edit a selected symbol on the Stage.
Edit in New Window lets you edit a selected symbol in a new window.
Show Movie Elements shows the elements in your document organized into scenes.
Show Symbol Definitions shows all the elements associated with a symbol.
Copy All Text to Clipboard copies selected text to the Clipboard. You can paste the text into
an external text editor for spell checking or other editing.
Cut, Copy, Paste, and Clear perform these common functions on a selected element.
Modifying an item in the display list modifies the corresponding item in the document.
Expand Branch expands the navigation tree at the selected element.
Collapse Branch collapses the navigation tree at the selected element.
Collapse Others collapses the branches in the navigation tree not containing the selected
element.
Print prints the hierarchical display list that appears in the Movie Explorer.
Using the Movie Explorer 29

Using Find and Replace

You can use the Find and Replace feature to find and replace a specified element in a Flash
document. You can search for a text string, a font, a color, a symbol, a sound file, a video file, or
an imported bitmap file.
You can replace the specified element with another element of the same type. Depending on the
type of specified element, there are different options available in the Find and Replace dialog box.
You can find and replace elements in the current document or the current scene. You can search
for the next occurrence or all occurrences of an element, and you can replace the current
occurrence or all occurrences.
Note: In a screen-based document, you can find and replace elements in the current document or the
current screen, but you can’t use scenes. For information on working with screens, see Chapter 12,
“Working with Screens (Flash Professional Only),” on page 215.
The Live Edit option lets you edit the specified element directly on the Stage. If you use Live Edit
when searching for a symbol, Flash opens the symbol in edit-in-place mode.
The Find and Replace Log at the bottom of the Find and Replace dialog box shows the location,
name, and type of the elements for which you are searching.
To open the Find and Replace dialog box:
1.
Select Edit > Find and Replace.
2.
Do one of the following:
Select Current Document from the Search In pop-up menu.
Select Current Scene from the Search In pop-up menu.

Finding and replacing text

When you find and replace text, you can enter the text string to find and the text string with
which to replace it. You can select options for searching by whole word, for matching case, and
for selecting which type of text element (text field contents, ActionScript strings, and so on) to
include in the search.
To find and replace text:
1.
Select Edit > Find and Replace.
2.
Select Text from the For pop-up menu.
3.
In the Text text box, enter the text that you want to find.
4.
In the Replace with Text text box, enter the text that you want to use to replace the existing text.
5.
Select options for searching text:
Whole Word searches for the specified text string as a whole word only, bounded on both sides
by spaces, quotes, or similar markers. When Whole Word is deselected, the specified text can be searched as part of a larger word. For example, when Whole Word is deselected, the word place can be searched as part of the word replace.
30 Chapter 1: Working with Flash Documents
Match Case searches for text that exactly matches the case (uppercase and lowercase character
formatting) of the specified text when finding and replacing.
Regular Expressions searches for text in regular expressions in ActionScript. An expression
is any statement that Flash can evaluate that returns a value. For more information, see ActionScript Reference Guide Help.
Text Field Contents searches the contents of a text field.
Frames/Layers/Parameters searches frame labels, layer names, scene names, and
component parameters.
Strings in ActionScript searches strings in ActionScript in the document or scene (external
ActionScript files are not searched).
6.
Select Live Edit to select the next occurrence of the specified text on the Stage and edit it in place.
Note: Only the next occurrence is selected for live editing, even if you select Find All in step 6.
7.
To find text, do one of the following:
Click Find Next to find the next occurrence of the specified text.
Click Find All to find all occurrences of the specified text.
8.
To replace text, do one of the following:
Click Replace to replace the currently selected occurrence of the specified text.
Click Replace All to replace all occurrences of the specified text.

Finding and replacing fonts

When you find and replace fonts, you can search or replace by font name, font style, font size, or
any combination of those characteristics.
To find and replace fonts:
1.
Select Edit > Find and Replace.
2.
Select Font from the For pop-up menu, then select from the following options:
To search by font name, select Font Name and select a font from the pop-up menu or enter
a font name in the text box. When Font Name is deselected, all fonts in the scene or document are searched.
To search by font style, select Font Style and select a font style from the pop-up menu.
When Font Style is deselected, all font styles in the scene or document are searched.
To search by font size, select Font Size and enter a value for minimum and maximum font
size to specify the range of font sizes to be searched. When Font Size is deselected, all font sizes in the scene or document are searched.
To replace the specified font with a different font name, select Font Name under Replace
With and select a font name from the pop-up menu or enter a name in the text box. When Font Name is deselected under Replace with, the current font name remains unchanged.
Using Find and Replace 31
To replace the specified font with a different font style, select Font Style under Replace
With and select a font style from the pop-up menu. When Font Style is deselected under Replace with, the current style of the specified font remains unchanged.
To replace the specified font with a different font size, select Font Size under Replace With
and enter values for minimum and maximum font size. When Font Size is deselected under Replace With, the current size of the specified font remains unchanged.
3.
Select Live Edit to select the next occurrence of the specified font on the Stage and edit it in place.
Note: Only the next occurrence is selected for live editing, even if you select Find All in step 4.
4.
To find a font, do one of the following:
Click Find Next to find the next occurrence of the specified font.
Click Find All to find all occurrences of the specified font.
5.
To replace a font, do one of the following:
Click Replace to replace the currently selected occurrence of the specified font.
Click Replace All to replace all occurrences of the specified font.

Finding and replacing colors

To find and replace a color, you can select a color to find or replace by picking a color swatch in
the color pop-up window, by entering a hexadecimal color value in the color pop-up window, by
using the system color picker, or by selecting a color from the desktop with the eyedropper tool.
You can find and replace a color in a stroke, in a fill, in text, or in any combination of those items.
You cannot find and replace colors in grouped objects.
Note: To find and replace colors in a GIF or JPEG file in a Flash document, edit the file in
Macromedia Fireworks or a similar image-editing application.
To find and replace a color:
1.
Select Edit > Find and Replace.
2.
Select Color from the For pop-up menu.
3.
To search for a color, click the Color control and do one of the following:
Select a color swatch from the color pop-up window.
Enter a hexadecimal color value in the Hex Edit text box in the color pop-up window.
Click the Color Picker button and select a color from the system color picker.
Drag from the Color control to make the eyedropper tool appear. Select any color on
your screen.
4.
To select a color to use in replacing the specified color, click the Color control under Replace With and do one of the following:
Select a color swatch from the color pop-up window.
Enter a hexadecimal color value in the Hex Edit text box in the color pop-up window.
32 Chapter 1: Working with Flash Documents
Click the Color Picker button and select a color from the system color picker.
Drag from the Color control to make the eyedropper tool appear. Select any color on
your screen.
5.
Select the Fills, Strokes, or Text option or any combination of those options to specify which occurrence of the color to find and replace.
6.
Select Live Edit to select the next occurrence of the specified color on the Stage and edit it in place.
Note: Only the next occurrence is selected for live editing, even if you select Find All in step 6.
7.
To find a color, do one of the following:
Click Find Next to find the next occurrence of the specified color.
Click Find All to find all occurrences of the specified color.
8.
To replace a color, do one of the following:
Click Replace to replace the currently selected occurrence of the specified color.
Click Replace All to replace all occurrences of the specified color.

Finding and replacing symbols

When you find and replace symbols, you can search for a symbol by name. You can replace a
symbol with another symbol of any type—movie clip, button, or graphic.
To find and replace a symbol:
1.
Select Edit > Find and Replace.
2.
Select Symbol from the For pop-up menu.
3.
For Name, select a name from the pop-up menu.
4.
Under Replace With, for Name select a name from the pop-up menu.
5.
Select Live Edit to select the next occurrence of the specified symbol on the Stage and edit it in place.
Note: Only the next occurrence is selected for editing, even if you select Find All in step 5.
6.
To find a symbol, do one of the following:
Click Find Next to find the next occurrence of the specified symbol.
Click Find All to find all occurrences of the specified symbol.
7.
To replace a symbol, do one of the following:
Click Replace to replace the currently selected occurrence of the specified symbol.
Click Replace All to replace all occurrences of the specified symbol.

Finding and replacing sound, video, or bitmap files

When you find and replace a sound, video, or bitmap file, you can search for the file by name.
You can replace the file with another file of the same type. That is, you can replace a sound with a
sound, a video with a video, or a bitmap with a bitmap.
Using Find and Replace 33
To find and replace a sound, video, or bitmap:
1.
Select Edit > Find and Replace.
2.
Select Sound, Video, or Bitmap from the For pop-up menu.
3.
For Name, enter a sound, video, or bitmap filename or select a name from the pop-up menu.
4.
Under Replace With, for Name enter a sound, video, or bitmap filename or select a name from the pop-up menu.
5.
Select Live Edit to select the next occurrence of the specified sound, video, or bitmap on the Stage and edit it in place.
Note: Only the next occurrence is selected for editing, even if you select Find All in step 5.
6.
To find a sound, video, or bitmap, do one of the following:
Click Find Next to find the next occurrence of the specified sound, video, or bitmap.
Click Find All to find all occurrences of the specified sound, video, or bitmap.
7.
To replace a sound, video, or bitmap, do one of the following:
Click Replace to replace the currently selected occurrence of the specified sound, video,
or bitmap.
Click Replace All to replace all occurrences of the specified sound, video, or bitmap.

Using the Undo, Redo, and Repeat menu commands

The Edit > Undo and Edit > Redo commands let you undo and redo steps as you work on
Flash documents. The names of the Undo and Redo commands change to reflect the last
step performed.
To remove deleted items from a document after using the Undo command, you use the Save and
Compact command. See “Saving documents when you undo steps” on page 37.
You can use the Repeat command to reapply a step to the same object or to a different object. For
example, if you move a shape named shape_A, you can select Edit > Repeat to move the shape
again, or you can select another shape, shape_B, and select Edit > Repeat to move the second
shape by the same amount.
By default, Flash supports 100 levels of undo for the Undo menu command. You can select the
number of undo and redo levels, from 2 to 9999, in Flash Preferences. For more information, see
“Setting preferences in Flash” in Getting Started with Flash.
To undo a step:
Select Edit > Undo.
To redo a step:
Select Edit > Redo.
To repeat a step:
With an object selected on the Stage, select Edit > Repeat.
34 Chapter 1: Working with Flash Documents

Using the History panel

The History panel shows a list of the steps you’ve performed in the active document since you
created or opened that document, up to a specified maximum number of steps. (The History
panel doesn’t show steps you’ve performed in other documents.) The slider in the History panel
initially points to the last step that you performed.
You can use the History panel to undo or redo individual steps or multiple steps at once. You can
apply steps from the History panel to the same object or to a different object in the document.
However, you cannot rearrange the order of steps in the History panel. The History panel is a
record of steps in the order in which they were performed.
Note: If you undo a step or a series of steps and then do something new in the document, you can no
longer redo the steps in the History panel; they disappear from the panel.
To remove deleted items from a document after you undo a step in the History panel, you use the
Save and Compact command. For more information, see “Saving documents when you undo
steps” on page 37.
By default, Flash supports 100 levels of undo for the History panel. You can select the number of
undo and redo levels, from 2 to 9999, in Flash Preferences. For more information, see “Setting
preferences in Flash” in Getting Started with Flash.
You can clear the History panel to erase the history list for the current document. After clearing
the history list, you cannot undo the steps that are cleared. Clearing the history list does not undo
steps; it merely removes the record of those steps from the current document’s memory.
Closing a document clears its history. If you know you want to use steps from a document after
that document is closed, copy the steps with the Copy Steps command or save the steps as a
command. For more information, see “Copying and pasting steps between documents”
on page 36 or “Automating tasks with the Commands menu” on page 37.
To open the History panel:
Select Window > Other Panels > History.
To erase the history list for the current document:
1.
In the History panel options menu, select Clear History.
2.
Click Yes to confirm the Clear command.

Undoing steps with the History panel

You can undo the last step or multiple steps with the History panel. When you undo a step, the
step is dimmed in the History panel.
To undo the last step performed:
Drag the History panel slider up one step in the list.
Using the History panel 35
To undo multiple steps at once:
Drag the slider to point to any step.
Click to the left of a step along the path of the slider; the slider scrolls automatically to that
step, undoing all subsequent steps as it scrolls.
Note: Scrolling to a step (and selecting the subsequent steps) is different from selecting an individual step. To scroll to a step, you must click to the left of the step.

Replaying steps with the History panel

You can replay individual steps or multiple steps using the History panel.
When you replay steps with the History panel, the steps that play are the steps that are selected
(highlighted) in the History panel, not necessarily the step currently indicated by the slider.
You can apply steps in the History panel to any selected object in the document.
To replay one step:
In the History panel, select a step and click the Replay button. The step replays and a copy of
it appears in the History panel.
To replay a series of adjacent steps:
1.
Select steps in the History panel by doing one of the following:
Drag from one step to another. (Don’t drag the slider; just drag from the text label of one
step to the text label of another step.)
Select the first step, then Shift-click the last step; or select the last step and then Shift-click
the first step.
2.
Click Replay.
The steps replay in order, and a new step, labeled Replay Steps, appears in the History panel.
To replay nonadjacent steps:
1.
Select a step in the History panel, and Control-click (Windows) or Command-click (Macintosh) other steps.
You can also Control-click or Command-click to deselect a selected step.
2.
Click Replay.
The selected steps replay in order, and a new step, labeled Replay Steps, appears in the History panel.

Copying and pasting steps between documents

Each open document has its own history of steps. You can copy steps from one document and
paste them into another, using the Copy Steps command in the History panel options menu. If
you copy steps into a text editor, the steps are pasted as JavaScript code.
36 Chapter 1: Working with Flash Documents
To reuse steps from one document in another document:
1.
In the document containing the steps you want to reuse, select the steps in the History panel.
2.
In the History panel options menu, select Copy Steps.
3.
Open the document into which you want to paste the steps.
4.
Select an object to which you want to apply the steps.
5.
Select Edit > Paste to paste the steps.
The steps play back as they’re pasted into the document’s History panel. The History panel shows them as only one step, called Paste Steps.

Saving documents when you undo steps

By default, when you undo a step using Edit > Undo or the History panel, the file size of the
Flash document does not change, even if you delete an item in the document. For example, if you
import a video file into a document, and then undo the import, the file size of the document still
includes the size of the video file. This is because any items that you delete from a document
when performing an Undo command are preserved in case you want to restore the items with a
Redo command. You can permanently remove the deleted items from the document, and reduce
the document file size, by using the Save and Compact command.
To permanently remove items deleted by the Undo command:
Select File > Save and Compact.

Automating tasks with the Commands menu

When you create documents, you might want to perform the same task numerous times. You can
create a new command in the Commands menu from steps in the History panel and reuse the
command multiple times. Steps replay exactly as they were originally performed. You can’t modify
the steps as you replay them.
You should create and save a new command if there’s a chance you might want to use a set of
steps again, especially if you want to use those steps the next time you start Flash. Saved
commands are retained permanently, unless you delete them. Steps that you copy using the
History panel Copy Steps command are discarded when you copy something else. For more
information, see “Copying and pasting steps between documents” on page 36.

About steps that can’t be used in commands

Some tasks in Flash can’t be saved as commands or repeated using the Edit > Repeat menu item.
These commands can be undone and redone, but they cannot be repeated.
Examples of actions that can’t be saved as commands or repeated include selecting a frame or
modifying a document size. If you attempt to save an unrepeatable action as a command, the
command is not saved.
Automating tasks with the Commands menu 37

Creating and managing commands

You can create a command from selected steps in the History panel. In the Manage Saved
Commands dialog box, you can rename or delete commands.
To create a command:
1.
Select a step or set of steps in the History panel.
2.
Select Save As Command from the History panel options menu.
3.
Enter a name for the command and click OK.
The command appears in the Commands menu.
Note: The command is saved as a JavaScript file (with the extension .jsfl) in your Flash MX 2004\<language>\First Run\Commands folder.
To edit the names of commands in the Commands menu:
1.
Select Commands > Edit Command List.
2.
Select a command to rename and enter a new name for it.
3.
Click Close.
To delete a name from the Commands menu:
1.
Select Commands > Edit Command List.
2.
Select a command.
3.
Click Delete, and click Close.

Running commands

You can use the commands that you create by selecting the command name from the
Commands menu.
You can also run commands that are available on your system as JavaScript or Flash
JavaScript files.
To use a saved command:
Select the command from the Commands menu.
To run a JavaScript or Flash JavaScript command:
1.
Select Commands > Run Command.
2.
Navigate to the script that you want to run, and click Open.

Getting more commands

You can use the Get More Commands option in the Commands menu to link to the Flash
Exchange website at www.macromedia.com/cfusion/exchange/index.cfm and download
commands that other Flash users have posted. For more information on the commands posted
there, see Flash Exchange.
38 Chapter 1: Working with Flash Documents
To get more commands:
1.
Make sure you are connected to the Internet.
2.
Select Commands > Get More Commands.

About customizing context menus in Flash documents

You can customize the standard context menu and the text-editing context menu that appears
with Flash documents in Flash Player 7.
The standard context menu appears when a user right-clicks (Windows) or Control-clicks
(Macintosh) on a document in Flash Player, in any area except an editable text field. You can add custom items to the menu, and hide any built-in items in the menu except Settings and Debugger.
The editing context menu appears when a user right-clicks (Windows) or Control-clicks
(Macintosh) in an editable text field in a document in Flash Player. You can add custom items to this menu. You cannot hide any built-in items.
Note: Flash Player also displays an error context menu when a user right-clicks (Windows) or
Control-clicks (Macintosh) in Flash Player and no document is loaded. You cannot customize
this menu.
You customize context menus in Flash Player 7 using the contextMenu and contextMenuItem
objects in ActionScript. For more information on using these objects, see “ContextMenu class” in
Flash ActionScript Language Reference.
Remember the following criteria when creating custom context menu items for Flash Player:
Custom items are added to a context menu in the order in which they are created. You cannot
modify this order after the items are created.
You can specify the visibility and enabling of custom items.
Custom context menu items are automatically encoded using Unicode UTF-8 text encoding.

About the links menu in Flash Player

If a user is using a Netscape browser or an Active X application to display Flash Player, the player
displays a links menu for all Flash documents. If the user right-clicks (Windows) or Control-
clicks (Macintosh) on a text link in the Flash document, the links menu appears with the
following menu items:
Open opens the link.
Open in New Window opens the link in a new window.
Copy Link copies the link to the Clipboard.
In addition, the user can open a link in a new window by doing the following:
In a Windows Netscape browser: Control-click the link.
In a Macintosh Netscape browser: Command-click the link.
In an Active X application: Shift-click the link.
About the links menu in Flash Player 39

Speeding up document display

To speed up the document display, you can use commands in the View menu to turn off
rendering-quality features that require extra computing and slow down document display.
None of these commands have any effect on how Flash exports a document. To specify the
display quality of Flash documents in a web browser, you use the
object and embed parameters.
The Publish command can do this for you automatically. For more information, see “Publishing
Flash documents” on page 311.
To change the document display speed:
Select View > Preview Mode, and select from the following options:
Outlines displays only the outlines of the shapes in your scene and causes all lines to appear
as thin lines. This makes it easier to reshape your graphic elements and to display complex scenes quickly.
Fast turns off anti-aliasing and displays all the colors and line styles of your drawing.
Antialias turns on anti-aliasing for lines, shapes, and bitmaps. It displays shapes and lines so
that their edges appear smoother on the screen. This option draws more slowly than the Fast option. Anti-aliasing works best on video cards that provide thousands (16-bit) or millions (24-bit) of colors. In 16- or 256-color mode, black lines are smoothed, but colors might look better in Fast mode.
Antialias Text smooths the edges of any text. This command works best with large font sizes
and can be slow with large amounts of text. This is the most common mode in which to work.
Full renders all content on the Stage fully. This setting may slow down display.

Optimizing Flash documents

As your document file size increases, so does its download time and playback speed. You can take
several steps to prepare your document for optimal playback. As part of the publishing process,
Flash automatically performs some optimization on documents: for example, it detects duplicate
shapes on export and places them in the file only once, and it converts nested groups into single
groups.
Before exporting a document, you can optimize it further by using various strategies to reduce the
file size. You can also compress a SWF file as you publish it. (See Chapter 15, “Publishing,” on
page 309.) As you make changes, it’s a good idea to test your document by running it on a variety
of computers, operating systems, and Internet connections.
To optimize documents:
Use symbols, animated or otherwise, for every element that appears more than once.
When creating animation sequences, use tweened animations, whenever possible. These
animations use less file space than a series of keyframes.
For animation sequences, use movie clips instead of graphic symbols.
Limit the area of change in each keyframe; make the action take place in as small an area
as possible.
40 Chapter 1: Working with Flash Documents
Avoid animating bitmap elements; use bitmap images as background or static elements.
For sound, use MP3, the smallest sound format, whenever possible.
To optimize elements and lines:
Group elements as much as possible.
Use layers to separate elements that change during the animation from those that do not.
Use Modify > Curves > Optimize to minimize the number of separate lines that are used to
describe shapes.
Limit the number of special line types, such as dashed, dotted, ragged, and so on. Solid lines
require less memory. Lines created with the Pencil tool require less memory than brush strokes.
To optimize text and fonts:
Limit the number of fonts and font styles. Use embedded fonts sparingly because they increase
file size.
For Embed Fonts options, select only the characters needed instead of including the
entire font.
To optimize colors:
Use the Color menu in the symbol Property inspector to create many instances of a single
symbol in different colors.
Use the Color Mixer (Window > Color Mixer) to match the color palette of the document to a
browser-specific palette.
Use gradients sparingly. Filling an area with gradient color requires about 50 bytes more than
filling it with solid color.
Use alpha transparency sparingly because it can slow playback.

Testing document download performance

Flash Player attempts to meet the frame rate you set; the actual frame rate during playback can
vary on different computers. If a document that is downloading reaches a particular frame before
the frame’s required data has downloaded, the document pauses until the data arrives.
To view downloading performance graphically, you can use the Bandwidth Profiler, which shows
how much data is sent for each frame according to the modem speed you specify. The Bandwidth
Profiler is divided into two panes. The left pane shows information about the document, the
download settings, the state, and streams, if any are included. The right pane shows information
about individual frames in the document.
In simulating the downloading speed, Flash uses estimates of typical Internet performance, not
the exact modem speed. For example, if you select to simulate a modem speed of 28.8 Kbps, Flash
sets the actual rate to 2.3 Kbps to reflect typical Internet performance. The profiler also
compensates for the added compression support for SWF files, which reduces the file size and
improves streaming performance.
Testing document download performance 41
When external SWF files, GIF and XML files, and variables are streamed into a player by using
ActionScript calls such as
loadMovie and getUrl, the data flows at the rate set for streaming. The
stream rate for the main SWF file is reduced based on the reduction of bandwidth caused by the
additional data requests. It’s helpful to test your document at each speed and on each computer
that you plan to support. This helps you ensure that the document doesn’t overburden the slowest
connection and computer for which it is designed.
You can also generate a report of frames that are slowing playback and then optimize or eliminate
some of the content in those frames. For more information, see “Optimizing Flash documents”
on page 40.
To change the settings for the SWF file created using the Test Movie and Test Scene commands,
use File > Publish Settings. For more information, see “Publishing Flash documents”
on page 311.
To test download performance:
1.
Do one of the following:
Select Control > Test Scene or Control > Test Movie.
If you test a scene or document, Flash publishes the current selection as a SWF file using the settings in the Publish Settings dialog box. (See “Publishing Flash documents”
on page 311.) The SWF file opens in a new window and begins playing immediately.
Select File > Open, and select a SWF file.
2.
Select View > Download Settings, and select a download speed to determine the streaming rate that Flash simulates: 14.4 Kbps, 28.8 Kbps, 56 Kbps, DSL, T1 or a user setting. To enter a custom user setting, select Customize.
3.
When viewing the SWF file, select View > Bandwidth Profiler to show a graph of the downloading performance.
The left side of the profiler displays information about the document, its settings, its state, and streams, if any are included in the document.
The right section of the profiler shows the Timeline header and graph. In the graph, each bar represents an individual frame of the document. The size of the bar corresponds to that frame’s size in bytes. The red line beneath the Timeline header indicates whether a given frame streams in real time with the current modem speed set in the Control menu. If a bar extends above the red line, the document must wait for that frame to load.
4.
Select View > Simulate Download to turn streaming off or on.
If you turn streaming off, the document starts over without simulating a web connection.
5.
Click a bar on the graph to show settings for the corresponding frame in the left window and stop the document.
42 Chapter 1: Working with Flash Documents
6.
If necessary, adjust the view of the graph by taking one of the following actions:
Select View > Streaming Graph to show which frames cause pauses.
This default view displays alternating light and dark gray blocks that represent each frame. The side of each block indicates its relative byte size. The first frame stores a symbol’s contents, so it is often larger than other frames.
Select View > Frame by Frame Graph to display the size of each frame.
This view helps you see which frames contribute to streaming delays. If any frame block extends above the red line in the graph, Flash Player stops playback until the entire frame downloads.
7.
Close the test window to return to the authoring environment.
After you set up a test environment using the Bandwidth Profiler, you can open any SWF file
directly in test mode. The file opens in a Flash Player window, using the Bandwidth Profiler and
other selected viewing options.
For more information on debugging your documents, see Chapter 4, “Writing and Debugging
Scripts” in Using ActionScript in Flash.
To generate a report listing the amount of data in the final Flash Player file:
1.
Select File > Publish Settings, and click the Flash tab.
2.
Select Generate Size Report.
3.
Click Publish.
Flash generates a text file with the extension .txt. (If the document file is myMovie.fla, the text file is myMovie Report.txt.) The report lists the size of each frame, shape, text, sound, video and ActionScript script by frame.

Printing from the Flash authoring tool

You can print frames from Flash documents as you work, to preview and edit your documents.
You can also specify frames to be printable from Flash Player by a viewer that shows the Flash
document. See Chapter 18, “Printing from SWF Files,” on page 375.
When printing frames from a Flash document, you use the Print dialog box to specify the range
of scenes or frames you want to print as well as the number of copies. In Windows, the Page Setup
dialog box specifies paper size, orientation, and various print options—including margin settings
and whether all frames are to be printed for each page. On the Macintosh, these options are
divided between the Page Setup and the Print Margins dialog boxes.
The Print and Page Setup dialog boxes are standard within either operating system, and their
appearance depends on the selected printer driver.
Printing from the Flash authoring tool 43
To set printing options:
1.
Select File > Page Setup (Windows) or File > Print Margins (Macintosh).
2.
Set page margins. Select both Center options to print the frame in the center of the page.
3.
In the Frames pop-up menu, select whether to print all frames in the document or only the first frame of each scene.
4.
In the Layout pop-up menu, select from the following options:
Actual Size prints the frame at full size. Enter a value for Scale to reduce or enlarge the
printed frame.
Fit on One Page reduces or enlarges each frame so it fills the print area of the page.
Storyboard options print several thumbnails on one page. You can select from Boxes, Grid, or
Blank. Enter the number of thumbnails per page in the Frames text box. Set the space between the thumbnails in the Story Margin text box. Select Label to print the frame label as a thumbnail.
To print frames:
Select File > Print.
44 Chapter 1: Working with Flash Documents
CHAPTER 2

Working with Projects (Flash Professional Only)

In Macromedia Flash MX Professional 2004, you can use Flash Projects to manage multiple
document files in a single project. Flash Projects allow you to group multiple, related files together
to create complex applications.
You can use version-control features with projects to ensure that the correct file versions are used
during editing, and to prevent accidental overwriting. To use version control, you must first add
files to a project. For information on version control, see “Using version control with projects
(Flash Professional only)” on page 49.
Flash Projects include the following features:
A Flash Project can contain any Flash or other file type, including previous versions of FLA
and SWF files.
You can add an existing file to a Flash Project. Each file can be added to a particular Flash
Project only once. Files can be organized in nested folders.
A Flash Project is an XML file with the file extension .flp–for example, myProject.flp. The
XML file references all the document files contained in the Flash Project.
A Flash Project can contain another Flash Project (FLP file).
Changes that you make to a project are updated to the FLP file immediately, so the file is
always current. (You do not need to do a Save File operation.)
You can create a Flash Project in the Flash MX Professional 2004 authoring environment, or
you can create the XML file for a Flash Project in an external application.
Flash Projects use UTF-8 text encoding. All filenames and folder names in a Flash Project must
be UTF-8 compatible.
This chapter contains the following sections:
Creating and managing projects (Flash Professional only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Using version control with projects (Flash Professional only) . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Troubleshooting remote folder setup (Flash Professional only) . . . . . . . . . . . . . . . . . . . . . . . . . 51
45

Creating and managing projects (Flash Professional only)

You use the Flash Project panel to create and manage projects.The panel displays the contents of a
Flash Project in a collapsible tree structure. The panel title bar displays the project name.
If a project file is missing (not in its specified location), a Missing File icon appears next to the
filename. You can search for a missing file or delete the file from the project.
When you publish a project, each FLA file in the project is published with the publish profile
specified for that file. You should specify the publish profiles in the Project Settings dialog box
before you publish a project.
Only one project can be open at one time. If a project is open and you open or create another
project, Flash automatically saves and closes the first file.
To view the Flash Project panel:
Select Window > Project.
To view the Project pop-up menu:
When a project is open, click the Project button at the upper left corner of the Flash
Project panel.
To create a new project:
1.
Do one of the following to open a new project:
Select New Project from the Project pop-up menu.
If no other project is open, open the Flash Project panel and select Create a New Project in
the panel window.
Select File > New. On the General tab, select Flash Project.
If no project is currently open, right-click (Windows) or Control-click (Macintosh) in the
Document window of a saved Flash document or ActionScript file and select Add to New Project from the context menu.
2.
In the New Project dialog box, enter a name for the project and click Save.
To open an existing project, do one of the following:
Select Open Project from the Project pop-up menu. Navigate to the project and click Open.
Double-click the file.
If no other project is open, open the Flash Project panel and select Open an Existing Project in
the panel window. Navigate to the project and click Open.
Select File > Open. Navigate to the project and click Open.
46 Chapter 2: Working with Projects (Flash Professional Only)
To add a file, do one of the following:
Click the Add Files (+) button at the lower right corner of the Flash Project panel. Select one or
more files and click Add.
Right-click (Windows) or Control-click (Macintosh) in the Document window of an open
FLA or AS file and select Add to Project from the context menu.
Note: A file must be saved before you can add it to a project. You can add a file to a given project
only once. If you attempt to add a file to the same project more than once, Flash displays an
error message.
To create a folder:
1.
Click the Folder button at the lower right corner of the Flash Project panel.
2.
Enter a name for the folder and click OK.
Note: Folders at the same level on the same branch of the project tree structure must have unique
names. If there is a folder name conflict, Flash displays an error message.
To move a file or folder:
Drag the file or folder to a new location in the project tree structure. When you move a folder,
all of its contents are moved.
Note: If you drag a folder to a location with another folder of the same name, Flash merges the
contents of the two folders in the new location.
To delete a file or folder, select the item in the Flash Project panel and do one of
the following:
Click the Remove button at the lower right corner of the Flash Project panel.
Press the Delete key.
Right-click (Windows) or Control-click (Macintosh) the file or folder and select Remove from
the context menu.
To open a file from the Flash Project panel in Flash:
Double-click the filename in the Flash Project panel.
If the file is of a native file type (a type supported by the Flash authoring tool), the file opens in Flash. If it is nonnative file type, the file opens in the application used to create it.
To test a project:
1.
Click Test Project in the Flash Project panel.
2.
If the project contains no FLA, HTML, or HTM file, Flash displays an error message. Click OK and add a file of the appropriate type.
3.
If no FLA, HTML, or HTM file is designated as the default document, Flash displays an error message. Click OK. In the Select Default Document dialog box, select a document and click OK.
When a default document is present, the Test Project feature publishes all FLA files in the document. If the default document is a FLA file, the Test Movie command is executed. If it is an HTML file, a browser is opened.
Creating and managing projects (Flash Professional only) 47
To specify a publish profile for a FLA file in a project:
1.
Select the file in the Flash Project panel and do one of the following:
Select Settings from the Project pop-up menu.
Right-click (Windows) or Control-click (Macintosh) and select Settings from the
context menu.
2.
In the Project Settings dialog box, select the FLA file in the tree structure.
3.
Select a publish profile from the Profile menu. For information on publish profiles, see “Using
publish profiles” on page 327.
To publish a project:
Select Publish Project from the Project pop-up menu.
Note: Flash uses default publish profiles for publishing FLA files in the project, unless you select
other profiles. See the procedure above for selecting publish profiles.
To save files in a project when testing or publishing:
1.
Select Edit > Preferences (Windows) or Flash > Preferences (Macintosh) and click the Editing tab.
2.
Under Project Preferences, click Save Project Files on Test Project or Publish Project.
When this option is selected, Flash saves all open files in the current project before executing the Test Project or Publish Project operation.
To close a project:
Select Close Project from the Project pop-up menu.
By default, Flash closes all files in a project when you close the project. To change this behavior, deselect the Close Open Files on Project Close option in Editing Preferences.
To close all files when you close a project:
1.
Select Edit > Preferences (Windows) or Flash > Preferences (Macintosh) and click the Editing tab.
2.
Under Project Preferences, click Close Open Files on Project Close (selected by default).
When this option is selected, Flash closes all open files in the current project when the project is closed.
To rename a project or a folder:
1.
Select the project name or folder name in the Flash Project panel and do one of the following:
Select Rename from the Project pop-up menu.
Right-click (Windows) or Control-click (Macintosh) the item and select Rename from the
context menu.
2.
Enter a new name and click OK.
Note: By default, a project is given the same name as the first file added to the project. To rename a
project, you must use the Rename menu item. Renaming the FLP file for a project does not rename
the project.
48 Chapter 2: Working with Projects (Flash Professional Only)
To find a missing file:
1.
Select the filename in the Flash Project panel.
2.
Do one of the following:
Select Find Missing File from the Project pop-up menu.
Right-click (Windows) or Control-click (Macintosh) and select Find Missing File from the
context menu.
3.
Navigate to the file and click OK.

Using version control with projects (Flash Professional only)

Version control in Flash MX Professional 2004 lets you ensure that each author working in a
project file is always using the latest version of a file, and that multiple authors do not overwrite
each other’s work.
To use version-control features, you must define a site for the project. You can specify a local,
network, or FTP connection, or you can specify custom plug-ins for version control systems. If
you experience problems when setting up a remote site, see “Troubleshooting remote folder setup
(Flash Professional only)” on page 51.
On Windows, you can use Flash projects with SourceSafe. You must have Microsoft Visual
SourceSafe Client version 6 installed.
To define a site for version control:
1.
Create a new project and add files. See “Creating and managing projects (Flash Professional
only)” on page 46.
2.
Select File > Edit Sites.
3.
In the Edit Sites dialog box, click New.
4.
In the Site Definition dialog box, enter the site name, the local root path, and the e-mail address and name of the user.
5.
To specify a local, network, or FTP connection, select Local/Network or FTP from the Connection menu. Enter the location information for the Local/Network path or for the FTP connection and skip the next step.
Using version control with projects (Flash Professional only) 49
6.
To specify a Visual SourceSafe database, select SourceSafe Database from the Connection menu.
Note: SourceSafe database support is available for Windows only. You must have Microsoft Visual SourceSafe Client version 6 installed.
a
In the Database Path text box, click Browse to browse for the VSS database you want, or enter the full file path. The file you select becomes the srcsafe.ini file used to initialize SourceSafe.
b
In the Project text box, enter the project within the VSS database you want to use as the remote site’s root directory.
c
In the Username and Password text boxes, enter your login user name and password for the selected database. If you don’t know your username and password, check with your system administrator.
d
Click OK to return to the Site Definition dialog box.
7.
In the Flash Project panel (Window > Project), select Settings from the Project pop-up menu or context menu.
8.
In the Project Settings dialog box, select the site definition from the Site menu in the Version Control section. Click OK.
9.
In the Project pop-up menu, select Check In. Flash checks all files in the current project into the site.
To edit a file with version control applied:
1.
Open the project that contains the file, as described in “Creating and managing projects (Flash
Professional only)” on page 46.
2.
Select the file in the tree structure in the project panel and select Check Out from the project context menu.
The icon next to the filename in the tree structure indicates that the file is checked out.
3.
To check a file back in, select the file in the project panel and select Check In from the project context menu.
The icon next to the filename in the tree structure indicates that the file is checked in.
To open a file from a version-control site:
1.
Select File > Open from Site.
2.
In the Open from Site dialog box, select the site from the Site menu.
3.
Select the file in the site.
4.
If the file exists on your local system, Flash displays a message indicating whether the file is checked out and, if so, asking whether you want to overwrite it. Click Yes to overwrite the local version with the version from the remote site.
50 Chapter 2: Working with Projects (Flash Professional Only)

Troubleshooting remote folder setup (Flash Professional only)

A web server can be configured in a wide variety of ways. The following list provides information
on some common issues you may encounter in setting up a remote folder for use with version
control, and how to resolve them:
The Flash FTP implementation may not work properly with certain proxy servers, multilevel
firewalls, and other forms of indirect server access. If you encounter problems with FTP access, ask your local system administrator for help.
For the Flash FTP implementation, you must connect to the remote system’s root folder. (In
many applications, you can connect to any remote directory, then navigate through the remote file system to find the directory you want.) Be sure that you indicate the remote system’s root folder as the host directory.
If you have problems connecting, and you’ve specified the host directory using a single slash
(/), you might need to specify a relative path between the directory you are connecting to and the remote root folder. For example, if the remote root folder is a higher-level directory, you may need to specify a ../../ for the host directory.
Filenames and folder names that contain spaces and special characters often cause problems
when transferred to a remote site. Use underscores in place of spaces, and avoid special characters in filenames and folder names wherever possible. In particular, colons, slashes, periods, and apostrophes in filenames or folder names can cause problems.
If problems persist, try uploading with an external FTP program to find out if the problem is
specific to using FTP in Flash.
Troubleshooting remote folder setup (Flash Professional only) 51
52 Chapter 2: Working with Projects (Flash Professional Only)
CHAPTER 3

Using Symbols, Instances, and Library Assets

A symbol is a graphic, button, or movie clip that you create in Macromedia Flash MX 2004 or
Macromedia Flash MX Professional 2004.
You create the symbol only once; you can then reuse it throughout your document or in other
documents. A symbol can include artwork that you import from another application. Any symbol
that you create automatically becomes part of the library for the current document. For more
information on the library, see “Using the library to manage media assets” on page 17.
This chapter describes how to create symbols and instances in the Flash authoring environment.
You can also create buttons, movie clips, and graphics using the Button Class and MovieClip
Class (use the drawing methods of the MovieClip class to create graphics). See “Button class” and
“MovieClip class”in Flash ActionScript Language Reference.
When you create a symbol in the authoring environment, each symbol has its own Timeline. You
can add frames, keyframes, and layers to a symbol Timeline, just as you can to the main Timeline.
For more information, see “Using the Timeline” in Getting Started with Flash. If the symbol is a
movie clip or a button, you can control the symbol with ActionScript. For more information, see
Chapter 5, “Handling Events” in Using ActionScript in Flash.
An instance is a copy of a symbol located on the Stage or nested inside another symbol.
An instance can be very different from its symbol in color, size, and function. Editing the
symbol updates all of its instances, but applying effects to an instance of a symbol updates only
that instance.
Using symbols in your documents dramatically reduces file size; saving several instances of a
symbol requires less storage space than saving multiple copies of the contents of the symbol. For
example, you can reduce the file size of your documents by converting static graphics, such as
background images, into symbols and then reusing them. Using symbols can also speed SWF file
playback, because a symbol needs to be downloaded to Flash Player only once.
You can share symbols among documents as shared library assets during authoring or at runtime.
For runtime shared assets, you can link assets in a source document to any number of destination
document, without importing the assets into the destination document. For assets shared during
authoring, you can update or replace a symbol with any other symbol available on your local
network. See “Using shared library assets” on page 69.
53
If you import library assets that have the same name as assets already in the library, you can
resolve naming conflicts without accidentally overwriting existing assets. See “Resolving conflicts
between library assets” on page 72.
For an introduction to using symbols and instances, select Help > How Do I > Quick Tasks >
Create Symbols and Instances.
This chapter contains the following sections:
Types of symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
About controlling instances and symbols with ActionScript. . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Creating symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Creating instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Creating buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Enabling, editing, and testing buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Editing symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Changing instance properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Controlling instances with behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Breaking apart instances. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Getting information about instances on the Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Copying library assets between documents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Using shared library assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Resolving conflicts between library assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

Types of symbols

Each symbol has a unique Timeline and Stage, complete with layers. When you create a symbol
you choose the symbol type, depending on how you want to use the symbol in your document.
Use graphic symbols for static images and to create reusable pieces of animation that are tied to
the main Timeline. Graphic symbols operate in sync with the main Timeline. Interactive controls and sounds won’t work in a graphic symbol’s animation sequence.
Use button symbols to create interactive buttons that respond to mouse clicks, rollovers, or
other actions. You define the graphics associated with various button states, and then assign actions to a button instance. For more information, see Chapter 5, “Handling Events” in Using ActionScript in Flash.
Use movie clip symbols to create reusable pieces of animation. Movie clips have their own
multiframe Timeline that is independent from the main Timeline—think of them as nested inside a main Timeline that can contain interactive controls, sounds, and even other movie clip instances. You can also place movie clip instances inside the Timeline of a button symbol to create animated buttons.
54 Chapter 3: Using Symbols, Instances, and Library Assets
Use font symbols to export a font and use it in other Flash documents. See “Creating font
symbols” on page 116.
Flash provides built-in components, movie clips with defined parameters, that you can use to add user interface elements, such as buttons, check boxes, or scroll bars, to your documents. For more information, see Introduction, “Getting Started with Components,”in Using Components.
Note: To preview interactivity and animation in movie clip symbols in the Flash authoring
environment, you must select Control > Enable Live Preview.

About controlling instances and symbols with ActionScript

You can use ActionScript to control movie clip and button instances. The movie clip or button
instance must have a unique instance name to be used with ActionScript. For information on
assigning a name to an instance, see “Creating instances” on page 58. You can also use
ActionScript to control movie clip or button symbols. For more information, see Chapter 5,
“Handling Events” in Using ActionScript in Flash.

Creating symbols

You can create a symbol from selected objects on the Stage, or you can create an empty symbol
and make or import the content in symbol-editing mode. You can also create font symbols in
Flash. See “Creating font symbols” on page 116. Symbols can have all the functionality that you
can create with Flash, including animation.
By using symbols that contain animation, you can create Flash applications with a lot of
movement while minimizing file size. Consider creating animation in a symbol when there is a
repetitive or cyclic action—the up-and-down motion of a bird’s wings, for example.
You can also add symbols to your document by using shared library assets during authoring or at
runtime. See “Using shared library assets” on page 69.
To convert selected elements to a symbol:
1.
Select an element or several elements on the Stage. Then do one of the following:
Select Modify > Convert to Symbol.
Drag the selection to the Library panel.
Right-click (Windows) or Control-click (Macintosh) and select Convert to Symbol from
the context menu.
2.
In the Convert to Symbol dialog box, type the name of the symbol and select the behavior— Graphic, Button, or Movie Clip. See “Types of symbols” on page 54.
3.
Click in the registration grid to position the registration point for the symbol.
4.
Click OK.
Flash adds the symbol to the library. The selection on the Stage becomes an instance of the symbol. You cannot edit an instance directly on the Stage—you must open it in symbol­editing mode. You can also change the registration point for a symbol. See “Editing symbols”
on page 61.
Creating symbols 55
To create a new empty symbol:
1.
Make sure that nothing is selected on the Stage. Then do one of the following:
Select Modify > New Symbol.
Click the New Symbol button at the lower left of the Library panel.
Select New Symbol from the Library options menu in the upper right corner of the
Library panel.
2.
In the Create New Symbol dialog box, type the name of the symbol and select the behavior— Graphic, Button, or Movie Clip. See “Types of symbols” on page 54.
3.
Click OK.
Flash adds the symbol to the library and switches to symbol-editing mode. In symbol-editing mode, the name of the symbol appears above the upper left corner of the Stage, and a cross hair indicates the symbol’s registration point.
4.
To create the symbol content, use the Timeline, draw with the drawing tools, import media, or create instances of other symbols.
5.
When you have finished creating the symbol content, do one of the following to return to document-editing mode:
Click the Back button at the left of the Edit bar above the Stage.
Select Edit > Edit Document.
Click the scene name in the Edit bar above the Stage.
When you create a new symbol, the registration point is placed at the center of the window in symbol-editing mode. You can place the symbol contents in the window in relation to the registration point. You can also move the symbol contents in relation to the registration point when you edit a symbol, in order to change the registration point. See “Editing symbols”
on page 61.

Converting animation on the Stage into a movie clip

If you’ve created an animated sequence on the Stage and want to reuse it elsewhere in your
document, or if you want to manipulate it as an instance, you can select it and save it as a
movie clip symbol.
To convert animation on the Stage into a movie clip:
1.
On the main Timeline, select every frame in every layer of the animation on the Stage that you want to use. For information on selecting frames, see “Using the Timeline” in Getting Started with Flash.
2.
Do one of the following to copy the frames:
Right-click (Windows) or Control-click (Macintosh) any selected frame and select Copy
Frames from the context menu. Select Cut if you want to delete the sequence after converting it to a movie clip.
Select Edit > Timeline > Copy Frames. Select Cut Frames if you want to delete the sequence
after converting it to a movie clip.
56 Chapter 3: Using Symbols, Instances, and Library Assets
3.
Deselect your selection and make sure nothing on the Stage is selected. Select Modify > New Symbol.
4.
In the Create New Symbol dialog box, name the symbol. For Behavior, select Movie Clip, then click OK.
Flash opens a new symbol for editing in symbol-editing mode.
5.
On the Timeline, click Frame 1 on Layer 1, and select Edit > Timeline > Paste Frames.
This pastes the frames (and any layers and layer names) you copied from the main Timeline to the Timeline of this movie clip symbol. Any animation, buttons, or interactivity from the frames you copied now becomes an independent animation (a movie clip symbol) that you can reuse throughout your document.
6.
When you have finished creating the symbol content, do one of the following to return to document-editing mode:
Click the Back button at the left of the Edit bar above the Stage.
Select Edit > Edit Document.
Click the scene name in the Edit bar above the Stage.

Duplicating symbols

Duplicating a symbol lets you use an existing symbol as a starting point for creating a
new symbol.
You can also use instances to create versions of the symbol with different appearances. See
“Creating instances” on page 58.
To duplicate a symbol using the Library panel:
1.
Select a symbol in the Library panel.
2.
Do one of the following to duplicate the symbol:
Right-click (Windows) or Control-click (Macintosh) and select Duplicate from the
context menu.
Select Duplicate from the Library options menu.
To duplicate a symbol by selecting an instance:
1.
Select an instance of the symbol on the Stage.
2.
Select Modify > Symbol > Duplicate Symbol.
The symbol is duplicated and the instance is replaced with an instance of the duplicate symbol.
Creating symbols 57

Creating instances

After you create a symbol, you can create instances of that symbol wherever you like throughout
your document, including inside other symbols. When you modify the symbol, Flash updates all
instances of the symbol.
Flash gives movie clip and button instances default instance names when you create them. From
the Property inspector, you can apply custom names to instances. You use the instance name to
refer to an instance in ActionScript. You must give each instance a unique name in order to
control it with ActionScript. For more information, see Chapter 5, “Handling Events,” in Using
ActionScript in Flash.
To create a new instance of a symbol:
1.
Select a layer in the Timeline.
Flash can place instances only in keyframes, always on the current layer. If you don’t select a keyframe, Flash adds the instance to the first keyframe to the left of the current frame.
Note: A keyframe is a frame in which you define a change in the animation. For more information, see “Working with frames in the Timeline” in Getting Started with Flash.
2.
Select Window > Library to open the library.
3.
Drag the symbol from the library to the Stage.
4.
If you created an instance of a graphic symbol, select Insert > Timeline > Frame to add the number of frames that will contain the graphic symbol.
To apply a custom name to an instance:
1.
Select the instance on the Stage.
2.
Select Window > Properties if the Property inspector is not visible.
3.
Enter a name in the Instance Name text box on the left side of the Property inspector (below the Symbol Behavior pop-up list).
After creating an instance of a symbol, you can use the Property inspector to specify color effects,
assign actions, set the graphic display mode, or change the behavior of the instance. The behavior
of the instance is the same as the symbol behavior, unless you specify otherwise. Any changes you
make affect only the instance and not the symbol. See “Changing instance properties”
on page 62.

Creating buttons

Buttons are actually four-frame interactive movie clips. When you select the button behavior
for a symbol, Flash creates a Timeline with four frames. The first three frames display the
button’s three possible states; the fourth frame defines the active area of the button. The
Timeline doesn’t actually play; it simply reacts to pointer movement and actions by jumping to
the appropriate frame.
To make a button interactive, you place an instance of the button symbol on the Stage and assign
actions to the instance. You must assign the actions to the instance of the button in the
document, not to frames in the button’s Timeline.
58 Chapter 3: Using Symbols, Instances, and Library Assets
Each frame in the Timeline of a button symbol has a specific function:
The first frame is the Up state, representing the button whenever the pointer is not over
the button.
The second frame is the Over state, representing the button’s appearance when the pointer is
over the button.
The third frame is the Down state, representing the button’s appearance as it is clicked.
The fourth frame is the Hit state, defining the area that responds to the mouse click. This area
is invisible in the SWF file.
You can also create a button using a movie clip symbol or a button component. There are
advantages to using each type of button, depending on your needs. Creating a button using a
movie clip enables you to add more frames to the button or add more complex animation.
However, movie clip buttons have a larger file size than button symbols. Using a button
component allows you to bind the button to other components, to share and display data in an
application. Button components also include prebuilt features, such as accessibility support, and
can be customized. Button components include the PushButton and RadioButton. For more
information, see “Button component” in Using Components.
For a lesson on creating buttons with ActionScript, select Help > How Do I > Quick Tasks >
Write Scripts with ActionScript.
To create a button:
1.
Select Edit > Deselect All to ensure that nothing is selected on the Stage.
2.
Select Insert > New Symbol, or press Control+F8 (Windows) or Command+F8 (Macintosh).
To create the button, you convert the button frames to keyframes.
3.
In the Create New Symbol dialog box, enter a name for the new button symbol, and for Behavior select Button.
Flash switches to symbol-editing mode. The Timeline header changes to display four consecutive frames labeled Up, Over, Down, and Hit. The first frame, Up, is a blank keyframe.
4.
To create the Up state button image, use the drawing tools, import a graphic, or place an instance of another symbol on the Stage.
You can use a graphic or movie clip symbol in a button, but you cannot use another button in a button. Use a movie clip symbol if you want the button to be animated.
5.
Click the second frame, labeled Over, and select Timeline > Keyframe.
Flash inserts a keyframe that duplicates the contents of the Up frame.
6.
Change the button image for the Over state.
Creating buttons 59
7.
Repeat steps 5 and 6 for the Down frame and the Hit frame.
The Hit frame is not visible on the Stage, but it defines the area of the button that responds when clicked. Make sure that the graphic for the Hit frame is a solid area large enough to encompass all the graphic elements of the Up, Down, and Over frames. It can also be larger than the visible button. If you do not specify a Hit frame, the image for the Up state is used as the Hit frame.
You can create a disjoint rollover, in which moving the pointer over a button causes another graphic on the Stage to change. To do this, you place the Hit frame in a different location than the other button frames.
8.
To assign a sound to a state of the button, select that state’s frame in the Timeline, select Window > Properties, and then select a sound from the Sound menu in the Property inspector. For more information, see “Adding sounds to buttons” on page 204.
9.
When you finish, select Edit > Edit Document. Drag the button symbol from the Library panel to create an instance of it in the document.

Enabling, editing, and testing buttons

By default, Flash keeps buttons disabled as you create them, to make it easier to select and work
with them. When a button is disabled, clicking the button selects it. When a button is enabled, it
responds to the mouse events that you’ve specified as if the SWF file were playing. You can still
select enabled buttons, however. In general, it is best to disable buttons as you work, and enable
buttons to quickly test their behavior.
To enable and disable buttons:
Select Control > Enable Simple Buttons. A check mark appears next to the command to
indicate buttons are enabled. Select the command again to disable buttons.
Any buttons on the Stage now respond. As you move the pointer over a button, Flash displays the Over frame; when you click within the button’s active area, Flash displays the Down frame.
To select an enabled button:
Use the Selection tool to drag a selection rectangle around the button.
To move or edit an enabled button:
1.
Select the button, as described above.
2.
Do one of the following:
Use the arrow keys to move the button.
If the Property inspector is not visible, select Window > Properties to edit the button
in the Property inspector, or Alt-double-click (Windows) or Option-double-click the button (Macintosh).
60 Chapter 3: Using Symbols, Instances, and Library Assets
To test a button, do one of the following:
Select Control > Enable Simple Buttons. Move the pointer over the enabled button to test it.
Select the button in the Library panel and click the Play button in the Library
preview window.
Select Control > Test Scene or Control > Test Movie.
Movie clips in buttons are not visible in the Flash authoring environment. See “Enabling, editing,
and testing buttons” on page 60.

Editing symbols

When you edit a symbol, Flash updates all the instances of that symbol in your document. Flash
provides three ways for you to edit symbols. You can edit the symbol in context with the other
objects on the Stage using the Edit in Place command. Other objects are dimmed to distinguish
them from the symbol you are editing. The name of the symbol you are editing is displayed in an
Edit bar at the top of the Stage, to the right of the current scene name.
You can also edit a symbol in a separate window, using the Edit in New Window command.
Editing a symbol in a separate window lets you see the symbol and the main Timeline at the same
time. The name of the symbol you are editing is displayed in the Edit bar at the top of the Stage.
You edit the symbol by changing the window from the Stage view to a view of only the symbol,
using symbol-editing mode. The name of the symbol you are editing is displayed in the Edit bar
at the top of the Stage, to the right of the current scene name.
When you edit a symbol, Flash updates all instances of the symbol throughout the document to
reflect your edits. While editing a symbol, you can use any of the drawing tools, import media, or
create instances of other symbols.
You can change the registration point of a symbol (the point identified by the coordinates 0, 0)
using any symbol-editing method.
To edit a symbol in place:
1.
Do one of the following:
Double-click an instance of the symbol on the Stage.
Select an instance of the symbol on the Stage and right-click (Windows) or Control-click
(Macintosh), and select Edit in Place from the context menu.
Select an instance of the symbol on the Stage and select Edit > Edit in Place.
2.
Edit the symbol as needed.
3.
To change the registration point, drag the symbol on the Stage. A cross hair indicates the location of the registration point.
4.
To exit edit-in-place mode and return to document-editing mode, do one of the following:
Click the Back button at the left of the Edit bar at the top of the Stage.
Select the current scene name from the Scene pop-up menu in the Edit bar at the top
of the Stage.
Select Edit > Edit Document.
Editing symbols 61
To edit a symbol in a new window:
1.
Select an instance of the symbol on the Stage and right-click (Windows) or Control-click (Macintosh), and select Edit in New Window from the context menu.
2.
Edit the symbol as needed.
3.
To change the registration point, drag the symbol on the Stage. A cross hair indicates the location of the registration point.
4.
Click the Close box in the upper right corner (Windows) or upper left corner (Macintosh) to close the new window, and click in the main document window to return to editing the main document.
To edit a symbol in symbol-editing mode:
1.
Do one of the following to select the symbol:
Double-click the symbol’s icon in the Library panel.
Select an instance of the symbol on the Stage and right-click (Windows) or Control-click
(Macintosh) and select Edit from the context menu.
Select an instance of the symbol on the Stage and select Edit > Edit Symbols.
Select the symbol in the Library panel and select Edit from the Library options menu, or
right-click (Windows) or Control-click (Macintosh) the symbol in the Library panel and select Edit from the context menu.
2.
Edit the symbol as needed on the Stage.
3.
To change the registration point, drag the symbol on the Stage. A cross hair indicates the location of the registration point.
4.
To exit symbol-editing mode and return to editing the document, do one of the following:
Click the Back button at the left of the Edit bar at the top of the Stage.
Select Edit > Edit Document.
Click the scene name in the Edit bar at the top of the Stage.

Changing instance properties

Each symbol instance has its own properties that are separate from the symbol. You can change
the tint, transparency, and brightness of an instance; redefine how the instance behaves (for
example, change a graphic to a movie clip); and specify how animation plays inside a graphic
instance. You can also skew, rotate, or scale an instance without affecting the symbol.
In addition, you can name a movie clip or button instance so that you can use ActionScript to
change its properties. For more information, see Chapter 7, “Using the Built-In Classes,” in Using
ActionScript in Flash. To edit instance properties, you use the Property inspector
(Windows > Properties).
The properties of an instance are saved with it. If you edit a symbol or relink an instance to a
different symbol, any instance properties you’ve changed still apply to the instance.
62 Chapter 3: Using Symbols, Instances, and Library Assets

Changing the color and transparency of an instance

Each instance of a symbol can have its own color effect. To set color and transparency options for
instances, you use the Property inspector. Settings in the Property inspector also affect bitmaps
placed within symbols.
When you change the color and transparency for an instance in a specific frame, Flash makes the
change as soon as it displays that frame. To make gradual color changes, you must apply a motion
tween. When tweening color, you enter different effect settings in starting and ending keyframes
of an instance, and then tween the settings to make the instance’s colors shift over time. See
“Tweening instances, groups, and type” on page 165.
Note: If you apply a color effect to a movie clip symbol that has multiple frames, Flash applies the
effect to every frame in the movie clip symbol.
To change the color and transparency of an instance:
1.
Select the instance on the Stage and select Window > Properties.
2.
In the Property inspector, select one of the following options from the Color pop-up menu:
Brightness adjusts the relative lightness or darkness of the image, measured on a scale from
black (–100%) to white (100%). Click the triangle and drag the slider or enter a value in the text box to adjust brightness.
Tint colors the instance with the same hue. Use the Tint slider in the Property inspector to set
the tint percentage, from transparent (0%) to completely saturated (100%). Click the triangle and drag the slider or enter a value in the text box to adjust tint. To select a color, enter red, green, and blue values in the respective text boxes, or click the color box and select a color from the pop-up window or click the Color Picker button.
Alpha adjusts the transparency of the instance, from transparent (0%) to completely
saturated (100%). To adjust the alpha value, click the triangle and drag the slider or enter a value in the text box.
Advanced separately adjusts the red, green, blue, and transparency values of an instance. This
is most useful when you want to create and animate subtle color effects on objects such as bitmaps. The controls on the left let you reduce the color or transparency values by a specified percentage. The controls on the right let you reduce or increase the color or transparency values by a constant value.
The current red, green, blue, and alpha values are multiplied by the percentage values, and then added to the constant values in the right column, producing the new color values. For example, if the current red value is 100, setting the left slider to 50% and the right slider to 100 produces a new red value of 150 ([100 x .5] + 100 = 150).
Note: The Advanced settings in the Effect panel implement the function (a * y+ b)= x where a is the percentage specified in the left set of text boxes, y is the color of the original bitmap, b is the value specified in the right set of text boxes, and x is the resulting effect (between 0 and 255 for RGB, and 0 and 100 for alpha transparency).
You can also change the color of an instance using the ActionScript Color object. For detailed
information on the Color object, see “Color class” in Flash ActionScript Language Reference
Changing instance properties 63
.

Swapping one instance for another

You can assign a different symbol to an instance to display a different instance on the Stage and
preserve all the original instance properties, such as color effects or button actions.
For example, suppose you’re creating a cartoon with a rat symbol for your character, but decide to
change the character to a cat. You could replace the rat symbol with the cat symbol and have the
updated character appear in roughly the same location in all your frames.
To assign a different symbol to an instance:
1.
Select the instance on the Stage and select Window > Properties.
2.
Click the Swap button in the Property inspector.
3.
In the Swap Symbol dialog box, select a symbol to replace the one currently assigned to the instance. To duplicate a selected symbol, click the Duplicate Symbol button at the bottom of the dialog box.
Duplicating lets you base a new symbol on an existing one in the library and minimizes copying if you’re making several symbols that differ just slightly.
4.
Click OK.
To replace all instances of a symbol:
1.
Drag a symbol with the same name as the one you are replacing into the Library panel.
2.
In the Resolve Library Item Conflict dialog box, click Replace. For more information, see
“Resolving conflicts between library assets” on page 72.

Changing an instance’s type

You can change an instance’s type to redefine its behavior in a Flash application. For example, if a
graphic instance contains animation that you want to play independently of the main Timeline,
you could redefine the graphic instance as a movie clip instance.
To change an instance’s type:
1.
Select the instance on the Stage and select Window > Properties.
2.
Select Graphic, Button, or Movie Clip from the pop-up menu in the upper left corner of the Property inspector.

Setting the animation for graphic instances

You can determine how animation sequences inside a graphic instance play in your Flash
application by setting options in the Property inspector.
An animated graphic symbol is tied to the Timeline of the document in which the symbol is
placed. In contrast, a movie clip symbol has its own independent Timeline. Animated graphic
symbols, because they use the same Timeline as the main document, display their animation in
document-editing mode. Movie clip symbols appear as static objects on the Stage and do not
appear as animations in the Flash editing environment.
64 Chapter 3: Using Symbols, Instances, and Library Assets
To set the animation of a graphic instance:
1.
Select a graphic instance on the Stage and select Window > Properties.
2.
In the Property inspector, select an animation option from the pop-up menu below the instance name:
Loop loops all the animation sequences contained in the current instance for as many frames
as the instance occupies.
Play Once plays the animation sequence beginning from the frame you specify to the end of
the animation and then stops.
Single Frame displays one frame of the animation sequence. Specify which frame to display.

Controlling instances with behaviors

You can use behaviors to control movie clip and graphic instances in a document without writing
ActionScript. Behaviors are prewritten ActionScript scripts that let you add the power, control,
and flexibility of ActionScript coding to your document without having to create the
ActionScript code yourself.
You can use behaviors with an instance to arrange it in the stacking order on a frame, as well as to
load or unload, play, stop, duplicate, or drag a movie clip, or to link to a URL.
In addition, you can use behaviors to load an external graphic or an animated mask into a
movie clip.
To control a movie clip with a behavior, you use the Behaviors panel to apply the behavior to a
triggering object, such as a button. You specify the event that triggers the behavior (such as
releasing the button), select a target object (the movie clip instance) that is affected by the
behavior, and when necessary, specify settings for the behavior parameters, such as a frame
number or label.
The behaviors in the following table are packaged with Flash MX 2004 and Flash MX
Professional 2004. For more information on embedded video behaviors, see “Controlling video
playback using behaviors” on page 191. For more information on controlling sounds with
behaviors, see “Controlling sound playback using behaviors” on page 206.
Behavior Purpose Select/input
Load Graphic Loads an external JPEG file into a
Load External Movie Clip
Duplicate Movieclip Duplicates a movie clip or screen Instance name of movie clip to
GotoAndPlay at frame or label
movie clip or screen.
Loads an external SWF file into a target movie clip or screen.
Plays a movie clip from a particular frame.
Path and filename of JPEG file. Instance name of movie clip or screen receiving the graphic.
URL of external SWF file. Instance name of movie clip or screen
receiving the SWF file.
duplicate. X-offset and Y-offset of pixels from original to copy.
Instance name of target clip to play. Frame number or label to play.
Controlling instances with behaviors 65
Behavior Purpose Select/input
GotoAndStop at frame or label
Bring to Front Brings target movie clip or screen to
Bring Forward Brings target movie clip or screen
Send to Back Sends the target movie clip to the
Send Backward Sends the target movie clip or
Start Dragging movieclip
Stop Dragging movieclip
To add and configure a behavior:
1.
Select the object, such as a button, that will trigger the behavior.
2.
In the Behaviors panel (Window > Development Panels > Behaviors), click the Add (+) button
Stops a movie clip, optionally moving the playhead to a particular frame.
the top of the stacking order.
one position higher in the stacking order.
bottom of the stacking order.
screen one position lower in the stacking order.
Starts dragging a movie clip. Instance name of movie clip or screen.
Stops the current drag.
Instance name of target clip to stop. Frame number or label to stop.
Instance name of movie clip or screen.
Instance name of movie clip or screen.
Instance name of movie clip or screen.
Instance name of movie clip or screen.
and select the desired behavior from the Movieclip submenu.
3.
In the dialog box that appears, select the movie clip that you want to control with the behavior.
4.
Select a relative or absolute path. For more information, see “Abs olut e pat h s” on pa ge 24 and
“Relative paths” on page 25.
5.
If required, select or input settings for the behavior parameters and click OK.
Default settings for the behavior appear in the Behaviors panel.
6.
Under Event, click On Release (the default event) and select a mouse event from the menu. If you want to use the On Release event, leave the option unchanged.
66 Chapter 3: Using Symbols, Instances, and Library Assets

Breaking apart instances

To break the link between an instance and a symbol and make the instance into a collection of
ungrouped shapes and lines, you “break apart” the instance. This is useful for changing the
instance substantially without affecting any other instance. If you modify the source symbol after
breaking apart the instance, the instance is not updated with the changes.
To break apart an instance of a symbol:
1.
Select the instance on the Stage.
2.
Select Modify > Break Apart.
This breaks the instance into its component graphic elements.
3.
Use the painting and drawing tools to modify these elements as desired.

Getting information about instances on the Stage

As you create a Flash application, it can be difficult to identify a particular instance of a symbol
on the Stage, particularly if you are working with multiple instances of the same symbol. You can
identify instances using the Property inspector, the Info panel, or the Movie Explorer.
The Property inspector and Info panel display the symbol name of the selected instance and an
icon that indicates its type—graphic, button, or movie clip. In addition, you can view the
following information:
In the Property inspector, you can view the instance’s behavior and settings—for all instance
types, color effect settings, location, and size; for graphics, the loop mode and first frame that contains the graphic; for buttons, the instance name (if assigned) and tracking option; for movie clips, the instance name (if assigned). For location, the Property inspector displays the x and y coordinates of either the symbol’s registration point or the symbol’s upper left corner, depending on which option is selected in the Info panel.
In the Info panel, you can view the instance’s size and location; the location of its registration
point; its red (R), green (G), blue (B), and alpha (A) values (if the instance has a solid fill); and the location of the pointer. The Info panel also displays the x and y coordinates of either the symbol’s registration point or the symbol’s upper left corner, depending on which option is selected. To display the coordinates of the registration point, click the center square in the Coordinate grid in the Info panel. To display the coordinates of the upper left corner, click the upper left square in the Coordinate grid.
In the Movie Explorer, you can view the contents of the current document, including
instances and symbols. See “Using the Movie Explorer” on page 28.
In addition, in the Actions panel, you can view any actions assigned to a button or movie clip.
Getting information about instances on the Stage 67
To get information about an instance on the Stage:
1.
Select the instance on the Stage.
2.
Display the Property inspector or panel you want to use:
To display the Property inspector, select Window > Properties.
To display the Info panel, select Window > Design Panels > Info.
To display the Movie Explorer, select Window > Other Panels > Movie Explorer. For more
information on the Movie Explorer, see “Using the Movie Explorer” on page 28.
To display the Actions panel, select Window > Development Panels > Actions.
To view the symbol definition for the selected symbol in the Movie Explorer:
1.
Click the Show Buttons, Movie Clips, and Graphics button at the top of the Movie Explorer.
2.
Right-click (Windows) or Control-click (Macintosh) and select Show Symbol Instances and Go to Symbol Definition from the context menu; or select these options from the pop-up menu in the upper right corner of the Movie Explorer.
To jump to the scene containing instances of a selected symbol:
1.
Display the symbol definitions as described in the previous procedure.
2.
Right-click (Windows) or Control-click (Macintosh) and select Show Movie Elements and Go to Symbol Definition from the context menu; or select these options from the pop-up menu in the upper right corner of the Movie Explorer.

Copying library assets between documents

You can copy library assets from a source document into a destination document in a variety of
ways: by copying and pasting the asset, by dragging and dropping the asset, or by opening the
library of the source document in the destination document and dragging the source document
assets into the destination document.
You can also share symbols between documents as shared library assets during authoring or at
runtime. See “Using shared library assets” on page 69.
If you attempt to copy assets that have the same name as existing assets in the destination
document, the Resolve Library Conflicts dialog box lets you choose whether to overwrite the
existing assets or to preserve the existing assets and add the new assets with modified names. See
“Resolving conflicts between library assets” on page 72. You can organize library assets in folders
to minimize name conflicts when copying assets between documents. See “Working with folders
in the Library panel” on page 19.
68 Chapter 3: Using Symbols, Instances, and Library Assets
To copy a library asset by copying and pasting:
1.
Select the asset on the Stage in the source document.
2.
Select Edit > Copy.
3.
Make the destination document the active document.
4.
Place the pointer on the Stage and select Edit > Paste in Center to paste the asset in the center of the visible work area. Select Edit > Paste in Place to place the asset in the same location as in the source document.
To copy a library asset by dragging:
1.
With the destination document open in Flash, select the asset in the Library panel in the source document.
2.
Drag the asset into the Library panel in the destination document.
To copy a library asset by opening the source document library in the destination document:
1.
With the destination document active in Flash, select File > Import > Open External Library.
2.
Select the source document in the Open As Library dialog box and click Open.
3.
Drag an asset from the source document library onto the Stage or into the library of the destination document.

Using shared library assets

Shared library assets let you use assets from a source document in multiple destination
documents.You can share library assets in two different ways:
For runtime shared assets, assets from a source document are linked as external files in a
destination document. Runtime assets are loaded into the destination document during document playback—that is, at runtime. The source document containing the shared asset does not need to be available on your local network when you author the destination document. However, the source document must be posted to a URL in order for the shared asset to be available to the destination document at runtime.
For shared assets during authoring, you can update or replace any symbol in a document you
are authoring with any other symbol available on your local network. You can update the symbol in the destination document as you author the document. The symbol in the destination document retains its original name and properties, but its contents are updated or replaced with those of the symbol you select.
Using shared library assets can optimize your workflow and document asset management in
numerous ways. For example, you can use shared library assets to share a font symbol across
multiple sites, provide a single source for elements in animations used across multiple scenes or
document, or create a central resource library to use for tracking and controlling revisions.

Working with runtime shared assets

Using runtime shared library assets involves two procedures: First, the author of the source
document defines a shared asset in the source document and enters an identifier string for the
asset and a URL where the source document will be posted.
Using shared library assets 69
Second, the author of the destination document defines a shared asset in the destination
document and enters an identifier string and URL identical to those used for the shared asset in
the source document. Alternatively, the destination document author can drag the shared assets
from the posted source document into the destination document library.
In either scenario, the source document must be posted to the specified URL in order for the
shared assets to be available for the destination document.

Defining runtime shared assets in a source document

You use the Symbol Properties dialog box or the Linkage Properties dialog box to define
sharing properties for an asset in a source document, to make the asset accessible for linking to
destination documents.
To define a runtime shared asset in a source document:
1.
With the source document open, select Window > Library to display the Library panel.
2.
Do one of the following:
Select a movie clip, button, or graphic symbol in the Library panel and select Properties
from the Library options menu. Click the Advanced button to expand the Properties dialog box.
Select a font symbol, sound, or bitmap and select Linkage from the Library options menu.
3.
For Linkage, select Export for Runtime Sharing to make the asset available for linking to the destination document.
4.
Enter an identifier for the symbol in the Identifier text field. Do not include spaces. This is the name Flash uses to identify the asset when linking to the destination document.
Note: Flash also uses the linkage identifier to identify a movie clip or button that is used as an object in ActionScript. See Chapter 8, “Working with Movie Clips,” in Using ActionScript in Flash.
5.
Enter the URL where the SWF file containing the shared asset will be posted.
6.
Click OK.
When you publish the SWF file, you must post the SWF file to the URL specified in step 5, so that the shared assets will be available to destination documents.

Linking to runtime shared assets from a destination document

You use the Symbol Properties dialog box or the Linkage Properties dialog box to define sharing
properties for an asset in a destination document so that you can link the asset to a shared asset
in a source document. If the source document is posted to a URL, you can also link a shared
asset to a destination document by dragging the asset from the source document to the
destination document.
To embed the symbol in the destination document, you can turn off sharing for a shared asset in
the destination document.
70 Chapter 3: Using Symbols, Instances, and Library Assets
To link a shared asset to a destination document by entering the identifier and URL:
1.
In the destination document, select Window > Library to display the Library panel.
2.
Do one of the following:
Select a movie clip, button, or graphic symbol in the Library panel and select Properties
from the Library options menu. Click the Advanced button to expand the Properties dialog box.
Select a font symbol and select Linkage from the Library options menu.
3.
For Linkage, select Import for Runtime Sharing to link to the asset in the source document.
4.
Enter an identifier for the symbol in the Identifier text field that is identical to the identifier used for the symbol in the source document. Do not include spaces.
5.
Enter the URL where the SWF source file containing the shared asset is posted.
6.
Click OK.
To link a shared asset to a destination document by dragging:
1.
In the destination document, do one of the following:
Select File > Open.
Select File > Import > Open External Library.
2.
In the Open or Open as Library dialog box, select the source document and click Open.
3.
Drag the shared asset from the source document Library panel into the Library panel or onto the Stage in the destination document.
To turn off linkage for a symbol in a destination document:
1.
In the destination document, select the linked symbol in the Library panel and do one of the following:
If the asset is a movie clip, button, or graphic symbol, select Properties from the Library
options menu.
If the asset is a font symbol, select Linkage from the Library options menu.
2.
In the Symbol Properties dialog box or the Linkage Properties dialog box, deselect Import for Runtime Sharing.
3.
Click OK.

Updating or replacing symbols using sharing during authoring

You can update or replace a movie clip, button, or graphic symbol in a document with any other
symbol in a FLA file accessible on your local network. The original name and properties of the
symbol in the destination document are preserved, but the contents of the symbol are replaced
with the contents of the symbol you select. Any assets that the selected symbol uses are also copied
into the destination document.
Using shared library assets 71
To update or replace a symbol:
1.
With the document open, select a movie clip, button, or graphic symbol and select Properties from the Library options menu.
2.
If the Symbol Properties dialog box is in basic mode, click Advanced to display the Linkage and Source panels. If the Linkage and Source panel are open, go to Step 3.
3.
To select a new FLA file, under Source in the Symbol Properties dialog box, click Browse.
4.
In the Open dialog box, navigate to a FLA file containing the symbol that will be used to update or replace the selected symbol in the Library panel, and click Open.
5.
To select a new symbol in the FLA file, under Source, click Symbol.
6.
Navigate to a symbol and click Open.
7.
In the Symbol Properties dialog box, under Source, select Always Update Before Publishing to automatically update the asset if a new version is found at the specified source location.
8.
Click OK to close the Symbol Properties or Linkage Properties dialog box.

Resolving conflicts between library assets

If you import or copy a library asset into a document that already contains a different asset of the
same name, you can choose whether to replace the existing item with the new item. This option is
available with all the methods for importing or copying library assets, including the following:
Copying and pasting an asset from a source document
Dragging an asset from a source document or a source document library
Importing an asset
Adding a shared library asset from a source document
Using a component from the components panel
The Resolve Library Items dialog box appears when you attempt to place items that conflict with
existing items in a document. A conflict exists when you copy an item from a source document
that already exists in the destination document and the items have different modification dates.
You can avoid naming conflicts by organizing your assets inside folders in your document’s
library. The dialog box also appears when you paste a symbol or component into your document’s
Stage and you already have a copy of the symbol or component that has a different modification
date from the one you’re pasting.
If you choose not to replace the existing items, Flash attempts to use the existing item instead of
the conflicting item that you are pasting. For example, if you copy a symbol named Symbol 1 and
paste the copy into the Stage of a document that already contains a symbol named Symbol 1,
Flash creates an instance of the existing Symbol 1.
If you choose to replace the existing items, Flash replaces the existing items (and all their
instances) with the new items of the same name. If you cancel the Import or Copy operation, the
operation is canceled for all items (not just those items that conflict in the destination document).
72 Chapter 3: Using Symbols, Instances, and Library Assets
Only identical library item types may be replaced with each other. That is, you cannot replace a
sound named Test with a bitmap named Test. In such cases, the new items are added to the
library with the word Copy appended to the name.
Note: Replacing library items using this method is not undoable. Be sure to save a backup of your
FLA file before performing complex paste operations that are resolved by replacing conflicting
library items.
If the Resolve Library Conflict dialog box appears when you are importing or copying library
assets into a document, you can resolve the naming conflict.
To resolve naming conflicts between library assets, do one of the following:
Click Don’t Replace Existing Items to preserve the existing assets in the destination document.
Click Replace Existing Items to replace the existing assets and their instances with the new
items of the same name.
Resolving conflicts between library assets 73
74 Chapter 3: Using Symbols, Instances, and Library Assets
CHAPTER 4

Working with Color

Macromedia Flash MX 2004 and Macromedia Flash MX Professional 2004 provide a variety of
ways to apply, create, and modify colors. Using the default palette or a palette you create, you can
choose colors to apply to the stroke or fill of an object you are about to create, or one already on
the Stage. Applying a stroke color to a shape paints the outline of the shape with that color.
Applying a fill color to a shape paints the interior space of the shape with that color.
When applying a stroke color to a shape, you can select any solid color, and you can select the
style and weight of the stroke. For a shape’s fill, you can apply a solid color, gradient, or bitmap.
To apply a bitmap fill to a shape, you must import a bitmap into the current file. You can also
create an outlined shape with no fill by using No Color as a fill, or you can create a filled shape
with no outline by using No Color as an outline. And you can apply a solid color fill to text. See
“Setting text attributes” on page 111.
You can modify stroke and fill attributes in a variety of ways using the Paint Bucket,
Ink Bottle, Eyedropper, and Fill Transform tools, and the Lock Fill modifier for the Brush
or Paint Bucket tools.
With the Color Mixer you can easily create and edit solid colors and gradient fills in RGB and
HSB modes. You can import, export, delete, and otherwise modify the color palette for a file
using the Color Swatches panel. You can select colors in hexadecimal mode in the Color Mixer, as
well as in the Stroke and Fill pop-up windows in the Tools panel or Property inspector.
You can access the system color picker from the Stroke Color or Fill Color control in the Tools
panel, the shape Property inspector, or the Color Mixer.
To access the system color picker:
Alt-double-click (Windows) or Option-double-click (Macintosh) the Stroke Color or Fill
Color control in the Tools panel, the shape Property inspector, or the Color Mixer.
This chapter contains the following sections:
Using the Stroke Color and Fill Color controls in the Tools panel . . . . . . . . . . . . . . . . . . . . . . 76
Using the Stroke Color and Fill Color controls in the Property inspector. . . . . . . . . . . . . . . . . 76
Modifying strokes with the Ink Bottle tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Applying solid, gradient, and bitmap fills with the Paint Bucket tool . . . . . . . . . . . . . . . . . . . . 79
75
Transforming gradient and bitmap fills . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Copying strokes and fills with the Eyedropper tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Locking a gradient or bitmap to fill the Stage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Modifying color palettes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

Using the Stroke Color and Fill Color controls in the Tools panel

The Stroke Color and Fill Color controls in the Tools panel let you select a solid stroke color or a
solid or gradient fill color, switch the stroke and fill colors, or select the default stroke and fill
colors (black stroke and white fill). Oval and rectangle objects (shapes) can have both stroke and
fill colors. Text objects and brush strokes can have only fill colors. Lines drawn with the Line,
Pen, and Pencil tools can have only stroke colors.
The Tools panel Stroke Color and Fill Color controls set the painting attributes of new objects
you create with the drawing and painting tools. To use these controls to change the painting
attributes of existing objects, you must first select the objects on the Stage.
Note: Gradient swatches appear only in the Fill Color control.
To apply stroke and fill colors using the Tools panel controls, do one of the following:
Click the triangle next to the Stroke or Fill color box and select a color swatch from the pop-up
window. Gradients can be selected for the fill color only.
Click the Color Picker button in the color pop-up window and select a color from the
Color Picker.
Type a color’s hexadecimal value in the text box in the color pop-up window.
Click the Default Fill and Stroke button in the Tools panel to return to the default color
settings (white fill and black stroke).
Click the No Color button in the color pop-up window to remove any stroke or fill.
Note: The No Color button appears only when you are creating a new oval or rectangle. You can create a new object without a stroke or fill, but you cannot use the No Color button with an existing object. Instead, select the existing stroke or fill and delete it.
Click the Swap Fill and Stroke button in the Tools panel to swap colors between the fill and
the stroke.

Using the Stroke Color and Fill Color controls in the Property inspector

To change the stroke color, style, and weight for a selected object, you can use the Stroke Color
controls in the Property inspector. For stroke style, you can choose from styles that are preloaded
with Flash, or you can create a custom style.
To select a solid color fill, you can use the Fill Color control in the Property inspector.
76 Chapter 4: Working with Color
To select a stroke color, style, and weight using the Property inspector:
1.
Select an object or objects on the Stage (for symbols, first double-click to enter symbol-editing mode).
2.
If the Property inspector is not visible, select Window > Properties.
3.
To select a color, click the triangle next to the Stroke color box and do one of the following:
Select a color swatch from the palette.
Type a color’s hexadecimal value in the text box.
4.
To select a stroke style, click the triangle next to the Style pop-up menu and select an option from the menu. To create a custom style, select Custom from the Property inspector, then select options in the Stroke Style dialog box and click OK.
Note: Selecting a stroke style other than Solid can increase file size.
5.
To select a stroke weight, click the triangle next to the Weight pop-up menu and set the slider at the desired weight.
To apply a solid color fill using the Property inspector:
1.
Select an object or objects on the Stage.
2.
Select Window > Properties.
3.
To select a color, click the triangle next to the Fill color box and do one of the following:
Select a color swatch from the palette.
Type a color’s hexadecimal value in the text box.

Working with solid colors and gradient fills in the Color Mixer

To create and edit solid colors and gradient fills, you can use the Color Mixer. If an object is
selected on the Stage, the color modifications you make in the Color Mixer are applied to
the selection.
You can create any color using the Color Mixer. You can select colors in RGB or HSB, or you
can expand the panel to use hexadecimal mode. You can also specify an alpha value to define
the degree of transparency for a color. In addition, you can select a color from the existing
color palette.
You can expand the Color Mixer to display a larger color space in place of the color bar, a split
color swatch showing the current and previous colors, and a Brightness control to modify color
brightness in all color modes.
To create or edit a solid color with the Color Mixer:
1.
To apply the color to existing artwork, select an object or objects on the Stage.
2.
Select Window > Design Panels > Color Mixer.
3.
To select a color mode display, select RGB (the default setting) or HSB from the pop-up menu in the upper right corner of the Color Mixer.
4.
Click the Stroke or Fill icon to specify which attribute is to be modified.
Note: Be sure to click the icon, not the color box, or the color pop-up window will open.
Working with solid colors and gradient fills in the Color Mixer 77
5.
If you selected the Fill icon in step 4, verify that Solid is selected in the Fill Style pop-up menu in the center of the Color Mixer.
6.
Click the arrow in the lower right corner to expand the Color Mixer.
7.
Do one of the following:
Click in the color space in the Color Mixer to select a color. Drag the Brightness control to
adjust the brightness of the color.
Note: To create colors other than black or white, make sure the Brightness control is not set to either extreme.
Enter values in the color value boxes: Red, Green, and Blue values for RGB display; Hue,
Saturation, and Brightness values for HSB display; or hexadecimal values for hexadecimal display. Enter an Alpha value to specify the degree of transparency, from 0 for complete transparency to 100 for complete opacity.
Click the Default Stroke and Fill button to return to the default color settings, black and
white (white fill and black stroke).
Click the Swap Stroke and Fill button to swap colors between the fill and the stroke.
Click the No Color button to apply no color to the fill or stroke.
Note: You cannot apply a stroke or fill of No Color to an existing object. Instead, select the existing stroke or fill and delete it.
Click the Stroke or Fill color box and select a color from the pop-up window.
8.
To add the color defined in step 7 to the color swatch list for the current document, select Add Swatch from the pop-up menu in the upper right corner of the Color Mixer.
To create or edit a gradient fill with the Color Mixer:
1.
To apply a gradient fill to existing artwork, select an object or objects on the Stage.
2.
If the Color Mixer is not visible, select Window > Design Panels > Color Mixer.
3.
To select a color mode display, select RGB (the default setting) or HSB.
4.
Select a gradient type from the Fill Style pop-up menu in the center of the Color Mixer:
Linear Gradient creates a gradient that shades from the starting point to the end point in a
straight line.
Radial Gradient creates a gradient that shades from the starting point to the end point in a
circular pattern.
The gradient definition bar appears in place of the color bar in the Color Mixer, with pointers below the bar indicating each color in the gradient.
5.
Click the arrow in the lower right corner to expand the Color Mixer.
6.
To change a color in the gradient, click one of the pointers below the gradient definition bar and click in the color space that appears directly below the gradient bar in the expanded Color Mixer. Drag the Brightness control to adjust the lightness of the color.
7.
To add a pointer to the gradient, click on or below the gradient definition bar. Select a color for the new pointer as described in step 6.
78 Chapter 4: Working with Color
8.
To reposition a pointer on the gradient, drag the pointer along the gradient definition bar. Drag a pointer down and off of the gradient definition bar to remove it.
9.
To save the gradient, click the triangle in the upper right corner of the Color Mixer and select Add Swatch from the pop-up menu. The gradient is added to the Color Swatches panel for the current document.

Modifying strokes with the Ink Bottle tool

To change the stroke color, width, and style of lines or shape outlines, you can use the Ink Bottle
tool. You can apply only solid colors, not gradients or bitmaps, to lines or shape outlines.
Using the Ink Bottle tool, rather than selecting individual lines, makes it easier to change the
stroke attributes of multiple objects at one time.
To use the Ink Bottle tool:
1.
Select the Ink Bottle tool from the Tools panel.
2.
Select a stroke color as described in “Using the Stroke Color and Fill Color controls in the Tools
panel” on page 76.
3.
Select a stroke style and stroke width from the Property inspector. See “Using the Stroke Color
and Fill Color controls in the Property inspector” on page 76.
4.
Click an object on the Stage to apply the stroke modifications.

Applying solid, gradient, and bitmap fills with the Paint Bucket tool

The Paint Bucket tool fills enclosed areas with color. This tool lets you fill empty areas and change
the color of already painted areas. You can paint with solid colors, gradient fills, and bitmap fills.
You can use the Paint Bucket tool to fill areas that are not entirely enclosed, and you can have
Flash close gaps in shape outlines as you use the Paint Bucket tool. See “Working with imported
bitmaps” on page 138.
To use the Paint Bucket tool to fill an area:
1.
Select the Paint Bucket tool from the Tools panel.
2.
Select a fill color and style, as described in “Using the Stroke Color and Fill Color controls in
the Property inspector” on page 76.
3.
Click the Gap Size modifier and select a gap size option:
Select Don’t Close Gaps if you want to close gaps manually before filling the shape. Closing
gaps manually can be faster for complex drawings.
Select a Close option to have Flash fill a shape that has gaps.
Note: If gaps are too large, you might have to close them manually.
4.
Click the shape or enclosed area that you want to fill.
Applying solid, gradient, and bitmap fills with the Paint Bucket tool 79

Transforming gradient and bitmap fills

You can transform a gradient or bitmap fill by adjusting the size, direction, or center of the fill. To
transform a gradient or bitmap fill, you use the Fill Transform tool.
To adjust a gradient or bitmap fill with the Fill Transform tool:
1.
Select the Fill Transform tool.
2.
Click an area filled with a gradient or bitmap fill.
When you select a gradient or bitmap fill for editing, its center point appears, and its bounding box is displayed with editing handles. When the pointer is over any one of these handles, it changes to indicate the function of the handle.
Press Shift to constrain the direction of a linear gradient fill to multiples of 45°.
3.
Reshape the gradient or fill in any of the following ways:
To reposition the center point of the gradient or bitmap fill, drag the center point.
To change the width of the gradient or bitmap fill, drag the square handle on the side of the
bounding box. (This option resizes only the fill, not the object containing the fill.)
To change the height of the gradient or bitmap fill, drag the square handle at the bottom of
the bounding box.
To rotate the gradient or bitmap fill, drag the circular rotation handle at the corner. You can
also drag the lowest handle on the bounding circle of a circular gradient or fill.
80 Chapter 4: Working with Color
To scale a linear gradient or a fill, drag the square handle at the center of the bounding box.
To change the radius of a circular gradient, drag the middle circular handle on the
bounding circle.
To skew or slant a fill within a shape, drag one of the circular handles on the top or right
side of the bounding box.
To tile a bitmap inside a shape, scale the fill.
Note: To see all the handles when working with large fills or fills close to the edge of the Stage, select View > Work Area.

Copying strokes and fills with the Eyedropper tool

You can use the Eyedropper tool to copy fill and stroke attributes from one object and
immediately apply them to another object. The Eyedropper tool also lets you sample the image in
a bitmap to use as a fill. See “Breaking apart groups and objects” on page 155.
To use the Eyedropper tool to copy and apply stroke or fill attributes:
1.
Select the Eyedropper tool and click the stroke or filled area whose attributes you want to apply to another stroke or filled area.
When you click a stroke, the tool automatically changes to the Ink Bottle tool. When you click a filled area, the tool automatically changes to the Paint Bucket tool with the Lock Fill modifier turned on. See “Locking a gradient or bitmap to fill the Stage” on page 82.
2.
Click another stroke or filled area to apply the new attributes.
Copying strokes and fills with the Eyedropper tool 81

Locking a gradient or bitmap to fill the Stage

You can lock a gradient or bitmap fill to make it appear that the fill extends over the entire Stage
and that the objects painted with the fill are masks revealing the underlying gradient or bitmap.
For information on applying a bitmap fill, see “Applying a bitmap fill” on page 140.
When you select the Lock Fill modifier with the Brush or Paint Bucket tool and paint with the
tool, the bitmap or gradient fill extends across the objects you paint on the Stage.
Using the Lock Fill modifier creates the appearance of a single gradient or bitmap fill being applied to
separate objects on the Stage.
To use a locked gradient fill:
1.
Select the Brush or Paint Bucket tool and select a gradient or bitmap as a fill.
2.
Select Linear Gradient or Radial Gradient from the Fill Style pop-up menu in the center of the Color Mixer and then select the Brush or Paint Bucket tool.
3.
Click the Lock Fill modifier.
4.
First paint the areas where you want to place the center of the fill, and then move to other areas.
To use a locked bitmap fill:
1.
Select the bitmap you want to use.
2.
Select Bitmap from the Fill Style pop-up menu in the center of the Color Mixer before selecting the Brush or Paint Bucket tool.
3.
Select the Brush or Paint Bucket tool.
4.
Click the Lock Fill modifier.
5.
First paint the areas where you want to place the center of the fill, and then move to other areas.

Modifying color palettes

Each Flash file contains its own color palette, stored in the Flash document. Flash displays a file’s
palette as swatches in the Fill Color and Stroke Color controls and in the Color Swatches panel.
The default color palette is the web-safe palette of 216 colors. You can add colors to the current
color palette using the Color Mixer. See “Working with solid colors and gradient fills in the Color
Mixer” on page 77.
To import, export, and modify a file’s color palette, you use the Color Swatches panel. You can
duplicate colors, remove colors from the palette, change the default palette, reload the web-safe
palette if you have replaced it, or sort the palette according to hue.
You can import and export both solid and gradient color palettes between Flash files, as well as
between Flash and other applications, such as Macromedia Fireworks and Adobe Photoshop.
82 Chapter 4: Working with Color

Duplicating and removing colors

You can duplicate colors in the palette, delete individual colors, or clear all colors from the palette.
To duplicate a color or delete a color:
1.
If the Color Swatches panel is not visible, select Window > Design Panels > Color Swatches.
2.
Click the color that you want to duplicate or delete.
3.
Select Duplicate Swatch or Delete Swatch from the pop-up menu in the upper right corner.
To clear all colors from the color palette:
In the Color Swatches panel, select Clear Colors from the pop-up menu in the upper right
corner. All colors are removed from the palette except black and white.

Using the default palette and the web-safe palette

You can save the current palette as the default palette, replace the current palette with the default
palette defined for the file, or load the web-safe palette to replace the current palette.
To load or save the default palette:
In the Color Swatches panel, select one of the following commands from the pop-up menu in
the upper right corner:
Load Default Colors replaces the current palette with the default palette.
Save as Default saves the current color palette as the default palette. The new default palette is
used when you create new files.
To load the web-safe 216-color palette:
In the Color Swatches panel, select Web 216 from the pop-up menu in the upper right corner.

Sorting the palette

To make it easier to locate a color, you can sort colors in the palette by hue.
To sort colors in the palette:
In the Color Swatches panel, select Sort by Color from the pop-up menu in the upper
right corner.

Importing and exporting color palettes

To import and export both RGB colors and gradients between Flash files, you use Flash Color
Set files (CLR files). You can import and export RGB color palettes using Color Table files (ACT
files) that can be used with Macromedia Fireworks and Adobe Photoshop. You can also
import color palettes, but not gradients, from GIF files. You cannot import or export
gradients from ACT files.
Modifying color palettes 83
To import a color palette:
1.
In the Color Swatches panel, select one of the following commands from the pop-up menu in the upper right corner:
To append the imported colors to the current palette, select Add Colors.
To replace the current palette with the imported colors, select Replace Colors.
2.
Navigate to the desired file and select it.
3.
Click OK.
To export a color palette:
1.
In the Color Swatches panel, select Save Colors from the pop-up menu in the upper right corner.
2.
In the dialog box that appears, enter a name for the color palette.
3.
For Save As Type (Windows) or Format (Macintosh), select Flash Color Set or Color Table. Click Save.
84 Chapter 4: Working with Color
CHAPTER 5

Drawing

The drawing tools in Macromedia Flash MX 2004 and Macromedia Flash MX Professional 2004
let you create and modify shapes for the artwork in your documents. For an interactive
introduction to drawing in Flash, select Help > How Do I > Basic Flash > Draw in Flash.
Before you draw and paint in Flash, it is important to understand how Flash creates artwork, how
drawing tools work, and how drawing, painting, and modifying shapes can affect other shapes on
the same layer.
This chapter contains the following sections:
About vector and bitmap graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Flash drawing and painting tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
About overlapping shapes in Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Drawing with the Pencil tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Drawing straight lines, ovals, and rectangles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Drawing polygons and stars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Using the Pen tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Painting with the Brush tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Reshaping lines and shape outlines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Erasing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Modifying shapes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Snapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Specifying drawing settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

About vector and bitmap graphics

Computers display graphics in either vector or bitmap format. Understanding the difference
between the two formats can help you work more efficiently. Using Flash, you can create and
animate compact vector graphics. Flash also lets you import and manipulate vector and bitmap
graphics that have been created in other applications.
85

Vector graphics

Vector graphics describe images using lines and curves, called vectors, that also include color and
position properties. For example, the image of a leaf is described by points through which lines
pass, creating the leaf’s outline. The color of the leaf is determined by the color of the outline and
the color of the area enclosed by the outline.
When you edit a vector graphic, you modify the properties of the lines and curves that describe its
shape. You can move, resize, reshape, and change the color of a vector graphic without changing
the quality of its appearance. Vector graphics are resolution-independent; that is, they can be
displayed on output devices of varying resolutions without losing any quality.

Bitmap graphics

Bitmap graphics describe images using colored dots, called pixels, arranged in a grid. For example,
the image of a leaf is described by the specific location and color value of each pixel in the grid,
creating an image in much the same manner as a mosaic.
When you edit a bitmap graphic, you modify pixels rather than lines and curves. Bitmap graphics
are resolution-dependent, because the data describing the image is fixed to a grid of a particular
size. Editing a bitmap graphic can change the quality of its appearance. In particular, resizing a
bitmap graphic can make the edges of the image ragged as pixels are redistributed within the grid.
Displaying a bitmap graphic on an output device that has a lower resolution than the image itself
also degrades its quality.
86 Chapter 5: Drawing

Flash drawing and painting tools

Flash provides various tools for drawing freeform or precise lines, shapes, and paths, and for
painting filled objects.
To draw freeform lines and shapes as if drawing with a real pencil, you use the Pencil tool. See
“Drawing with the Pencil tool” on page 88.
To draw precise paths as straight or curved lines, you use the Pen tool. See “Using the Pen tool”
on page 90.
To draw basic geometric shapes, you use the Line, Oval, and Rectangle tools. See “Drawing
straight lines, ovals, and rectangles” on page 89.
To draw polygons and stars, you use the PolyStar tool. See “Drawing polygons and stars”
on page 90.
To create brushlike strokes as if painting with a brush, you use the Brush tool. See “Painting
with the Brush tool” on page 95.
When you use most Flash tools, the Property inspector changes to present the settings associated
with that tool. For example, if you select the Text tool, the Property inspector displays text
properties, making it easy to select the text attributes you want. For more information on the
Property inspector, see “Using panels and the Property inspector” in Getting Started with Flash.
When you use a drawing or painting tool to create an object, the tool applies the current stroke
and fill attributes to the object. To change the stroke and fill attributes of existing objects, you can
use the Paint Bucket and Ink Bottle tools in the Tools panel or the Property inspector. See “Using
the Stroke Color and Fill Color controls in the Tools panel” on page 76 or “Using the Stroke
Color and Fill Color controls in the Property inspector” on page 76.
You can reshape lines and shape outlines in a variety of ways after you create them. Fills and
strokes are treated as separate objects. You can select fills and strokes separately to move or modify
them. See “Reshaping lines and shape outlines” on page 97.
You can use snapping to automatically align elements with each other and with the drawing grid
or guides. See “Snapping” on page 101 and“About the main toolbar and edit bar” in Getting
Started with Flash.
You can customize the Tools panel to change the display of tools. See “Customizing the Tools
panel” in Getting Started with Flash.
Flash drawing and painting tools 87

About overlapping shapes in Flash

When you use the Pencil, Line, Oval, Rectangle, or Brush tool to draw a line across another line
or painted shape, the overlapping lines are divided into segments at the intersection points. You
can use the Selection tool to select, move, and reshape each segment individually.
Note: Overlapping lines that you create with the Pen tool do not divide into individual segments at
intersection points, but remain connected. See “Using the Pen tool” on page 90.
A fill; the fill with a line drawn through it; and the two fills and three line segments created by
segmentation
When you paint on top of shapes and lines, the portion underneath is replaced by whatever is on
top. Paint of the same color merges together. Paint of different colors remains distinct. You can
use these features to create masks, cutouts, and other negative images. For example, the cutout
below was made by moving the ungrouped kite image onto the green shape, deselecting the kite,
and then moving the filled portions of the kite away from the green shape.
To avoid inadvertently altering shapes and lines by overlapping them, you can group the shapes
or use layers to separate them. See “Grouping objects” on page 146. For more information on
layers, see “Using layers” in Getting Started with Flash.

Drawing with the Pencil tool

To draw lines and shapes, you use the Pencil tool, in much the same way that you would use a real
pencil to draw. To apply smoothing or straightening to the lines and shapes as you draw, you can
select a drawing mode for the Pencil tool.
To draw with the Pencil tool:
1.
Select the Pencil tool.
2.
Select Window > Properties and select a stroke color, line weight, and style in the Property inspector. See “Using the Stroke Color and Fill Color controls in the Property inspector”
on page 76.
88 Chapter 5: Drawing
3.
Select a drawing mode under Options in the Tools panel:
Select Straighten to draw straight lines and convert approximations of triangles, ovals,
circles, rectangles, and squares into these common geometric shapes.
Select Smooth to draw smooth curved lines.
Select Ink to draw freehand lines with no modification applied.
Lines drawn with Straighten, Smooth, and Ink mode, respectively
4.
Drag on the Stage to draw with the Pencil tool. Shift-drag to constrain lines to vertical or horizontal directions.

Drawing straight lines, ovals, and rectangles

You can use the Line, Oval, and Rectangle tools to easily create these basic geometric shapes. The
Oval and Rectangle tools create stroked and filled shapes. The Rectangle tool lets you create
rectangles with square or rounded corners.
To draw a straight line, oval, or rectangle:
1.
Select the Line, Oval, or Rectangle tool.
2.
Select Window > Properties and select stroke and fill attributes in the Property inspector. See
“Using the Stroke Color and Fill Color controls in the Property inspector” on page 76.
Note: You cannot set fill attributes for the Line tool.
3.
For the Rectangle tool, specify rounded corners by clicking the Round Rectangle modifier and entering a corner radius value. A value of zero creates square corners.
4.
Drag on the Stage. If you are using the Rectangle tool, press the Up Arrow and Down Arrow keys while dragging to adjust the radius of rounded corners.
For the Oval and Rectangle tools, Shift-drag to constrain the shapes to circles and squares.
For the Line tool, Shift-drag to constrain lines to multiples of 45°.
Drawing straight lines, ovals, and rectangles 89

Drawing polygons and stars

Using the PolyStar tool you can draw polygons or stars. You can choose the number of sides of the
polygon or the number of points on the star, from 3 to 32. You can also choose the depth of the
star points.
To draw a polygon or star:
1.
Click and hold the mouse button on the Rectangle tool and dr ag to selec t the P olySta r to ol fro m the pop-up menu.
2.
Select Window > Properties to view the Property inspector.
3.
Select stroke and fill attributes in the Property inspector. See “Using the Stroke Color and Fill
Color controls in the Property inspector” on page 76.
4.
Click the Options button in the Property inspector.
5.
In the Tool Settings dialog box, do the following:
For Style, select Polygon or Star.
For Number of Sides, enter a number between 3 and 32.
For Star Point Size, enter a number between 0 and 1 to specify the depth of the star points.
A number closer to 0 creates deeper points (like needles). If you are drawing a polygon, leave this setting unchanged. (It does not affect the polygon shape.)
6.
Click OK to close the Tool Settings dialog box.
7.
Drag on the Stage.

Using the Pen tool

To draw precise paths as straight lines or smooth, flowing curves, you can use the Pen tool. You
can create straight or curved line segments and adjust the angle and length of straight segments
and the slope of curved segments.
When you draw with the Pen tool, you click to create points on straight line segments, and click
and drag to create points on curved line segments. You can adjust straight and curved line
segments by adjusting points on the line. You can convert curves to straight lines and the reverse.
You can also display points on lines that you create with other Flash drawing tools, such as the
Pencil, Brush, Line, Oval, or Rectangle tools, to adjust those lines. See “Reshaping lines and shape
outlines” on page 97.

Setting Pen tool preferences

You can specify preferences for the appearance of the Pen tool pointer, for previewing line
segments as you draw, or for the appearance of selected anchor points. Selected line segments
and anchor points are displayed using the outline color of the layer on which the lines and
points appear.
90 Chapter 5: Drawing
To set Pen tool preferences:
1.
Select the Pen tool, then select Edit > Preferences (Windows) or Flash > Preferences (Macintosh) and click the Editing tab.
2.
Under Pen Tool, set the following options:
Show Pen Preview previews line segments as you draw. Flash displays a preview of the line
segment as you move the pointer around the Stage, before you click to create the end point of the segment. If this option is not selected, Flash does not display a line segment until you create the end point of the segment.
Show Solid Points displays selected anchor points as hollow and deselected anchor points as
solid. If this option is not chosen, selected anchor points are solid, and deselected anchor points are hollow.
Show Precise Cursors specifies that the Pen tool pointer appear as a cross-hair pointer, rather
than the default Pen tool icon, for more precise placement of lines. Deselect the option to display the default Pen tool icon with the Pen tool.
Note: Press the Caps Lock key while working to switch between the cross-hair pointer and the default Pen tool icon.
3.
Click OK.

Drawing straight lines with the Pen tool

To draw straight line segments with the Pen tool, you create anchor points—points on the line
that determine the length of individual line segments.
To draw straight lines with the Pen tool:
1.
Select the Pen tool.
2.
Select Window > Properties and select stroke and fill attributes in the Property inspector. See
“Using the Stroke Color and Fill Color controls in the Property inspector” on page 76.
3.
Position the pointer on the Stage where you want the straight line to begin, and click to define the first anchor point.
4.
Click again where you want the first segment of the straight line to end. Shift-click to constrain lines to multiples of 45°.
5.
Continue clicking to create additional straight segments.
Using the Pen tool 91
6.
To complete the path as an open or closed shape, do one of the following:
To complete an open path, double-click the last point, click the Pen tool in the Tools panel,
or Control-click (Windows) or Command-click (Macintosh) anywhere away from the path.
To close a path, position the Pen tool over the first anchor point. A small circle appears next
to the pen tip when it is positioned correctly. Click or drag to close the path.
To complete the shape as is, select Edit > Deselect All or select a different tool in the Tools
panel.

Drawing curved paths with the Pen tool

You create curves by dragging the Pen tool in the direction you want the curve to go to create the
first anchor point, and then dragging the Pen tool in the opposite direction to create the second
anchor point.
When you use the Pen tool to create a curved segment, the anchor points of the line segment
display tangent handles. The slope and length of each tangent handle determine the slope and the
height, or depth, of the curve. Moving the tangent handles reshapes the curves of the path. See
“Adjusting segments” on page 94.
To draw a curved path:
1.
Select the Pen tool.
2.
Position the Pen tool on the Stage where you want the curve to begin, and hold down the mouse button.
The first anchor point appears, and the pen tip changes to an arrowhead.
3.
Drag in the direction you want the curve segment to be drawn. Shift-drag to constrain the tool to multiples of 45°.
As you drag, the tangent handles of the curve appear.
4.
Release the mouse button.
The length and slope of the tangent handles determine the shape of the curve segment. You can move the tangent handles later to adjust the curve.
92 Chapter 5: Drawing
5.
Position the pointer where you want the curve segment to end, hold down the mouse button, and drag in the opposite direction to complete the segment. Shift-drag to constrain the segment to multiples of 45°.
6.
To draw the next segment of a curve, position the pointer where you want the next segment to end, and drag away from the curve.

Adjusting anchor points on paths

When you draw a curve with the Pen tool, you create curve points—anchor points on a
continuous, curved path. When you draw a straight line segment, or a straight line connected to a
curved segment, you create corner pointsanchor points on a straight path or at the juncture of
a straight and a curved path.
By default, selected curve points appear as hollow circles, and selected corner points appear as
hollow squares.
To convert segments in a line from straight segments to curve segments or the reverse, you
convert corner points to curve points or the reverse.
You can also move, add, or delete anchor points on a path. You move anchor points using the
Subselection tool to adjust the length or angle of straight segments or the slope of curved
segments. You can nudge selected anchor points to make small adjustments.
Deleting unneeded anchor points on a curved path optimizes the curve and reduces the file size.
Using the Pen tool 93
To move an anchor point:
Drag the point with the Subselection tool.
To nudge an anchor point or points:
Select the point or points with the Subselection tool and use the arrow keys to move the point
or points.
To convert an anchor point, do one of the following:
To convert a corner point to a curve point, use the Subselection tool to select the point, then
Alt-drag (Windows) or Option-drag (Macintosh) the point to place the tangent handles.
To convert a curve point to a corner point, click the point with the Pen tool.
To add an anchor point:
Click a line segment with the Pen tool.
To delete an anchor point, do one of the following:
To delete a corner point, click the point once with the Pen tool.
To delete a curve point, click the point twice with the Pen tool. (Click once to convert the
point to a corner point, and once more to delete the point.)
Select the point with the Subselection tool and press Delete.

Adjusting segments

You can adjust straight segments to change the angle or length of the segment, or adjust curved
segments to change the slope or direction of the curve.
When you move a tangent handle on a curve point, the curves on both sides of the point adjust.
When you move a tangent handle on a corner point, only the curve on the same side of the point
as the tangent handle adjusts.
To adjust a straight segment:
1.
Select the Subselection tool, and select a straight segment.
2.
Use the Subselection tool to drag an anchor point on the segment to a new position.
To adjust a curve segment:
Select the Subselection tool and drag the segment.
Note: When you click the path, Flash shows the anchor points. Adjusting a segment with the Subselection tool may add points to the path.
94 Chapter 5: Drawing
To adjust points or tangent handles on a curve:
1.
Select the Subselection tool, and select an anchor point on a curved segment.
A tangent handle appears for the point you selected.
2.
To adjust the shape of the curve on either side of the anchor point, drag the anchor point, or drag the tangent handle. Shift-drag to constrain the curve to multiples of 45°. Alt-drag (Windows) or Option-drag (Macintosh) to drag tangent handles individually.

Painting with the Brush tool

The Brush tool draws brushlike strokes, as if you were painting. It lets you create special
effects, including calligraphic effects. You can select a brush size and shape using the Brush
tool modifiers.
Brush size for new strokes remains constant even when you change the magnification level for the
Stage, so the same brush size appears larger when the Stage magnification is lower. For example,
suppose you set the Stage magnification to 100% and paint with the Brush tool using the smallest
brush size. Then, you change the magnification to 50% and paint again using the smallest brush
size. The new stroke that you paint appears 50% thicker than the earlier stroke. (Changing the
magnification of the Stage does not change the size of existing brush strokes.)
You can use an imported bitmap as a fill when painting with the Brush tool. See “Breaking apart
groups and objects” on page 155.
If you have a Wacom pressure-sensitive tablet connected to your computer, you can vary the
width and angle of the brush stroke by using the Brush tool Pressure and Tilt modifiers, and
varying pressure on the stylus.
Painting with the Brush tool 95
The Pressure modifier varies the width of brush strokes when you vary the pressure on the stylus.
The Tilt modifier varies the angle of brush strokes when you vary the angle of the stylus on the
tablet. The Tilt modifier measures the angle between the top (eraser) end of the stylus and the top
(north) edge of the tablet. For example, if you hold the pen vertically against the tablet, the Tilt is
90°. The Pressure and Tilt modifiers are both fully supported for the eraser function of the stylus.
A variable-width brush stroke drawn with a stylus
To paint with the Brush tool:
1.
Select the Brush tool.
2.
Select Window > Properties and select a fill color in the Property inspector. See “Using the
Stroke Color and Fill Color controls in the Property inspector” on page 76.
3.
Click the Brush Mode modifier and select a painting mode:
Paint Normal paints over lines and fills on the same layer.
Paint Fills paints fills and empty areas, leaving lines unaffected.
Paint Behind paints in blank areas of the Stage on the same layer, leaving lines and
fills unaffected.
Paint Selection applies a new fill to the selection when you select a fill in the Fill modifier or
the Fill box of the Property inspector. (This option is the same as simply selecting a filled area and applying a new fill.)
Paint Inside paints the fill in which you start a brush stroke and never paints lines. This works
much like a smart coloring book that never allows you to paint outside the lines. If you start painting in an empty area, the fill doesn’t affect any existing filled areas.
4.
Select a brush size and brush shape from the Brush tool modifiers.
5.
If a Wacom pressure-sensitive tablet is attached to your computer, you can select the Pressure modifier, the Tilt modifier, or both, to modify brush strokes.
Select the Pressure modifier to vary the width of your brush strokes by varying the pressure
on your stylus.
Select the Tilt modifier to vary the angle of your brush strokes by varying the angle of the
stylus on the Wacom pressure-sensitive tablet.
6.
Drag on the Stage. Shift-drag to constrain brush strokes to horizontal and vertical directions.
96 Chapter 5: Drawing

Reshaping lines and shape outlines

You can reshape lines and shape outlines created with the Pencil, Brush, Line, Oval, or Rectangle
tools by dragging with the Selection tool, or by optimizing their curves.
You can also use the Subselection tool to display points on lines and shape outlines and modify
the lines and outlines by adjusting the points. For information on adjusting anchor points, see
“Using the Pen tool” on page 90.
To display anchor points on a line or shape outline created with the Pencil, Brush, Line,
Oval, or Rectangle tools:
1.
Select the Subselection tool.
2.
Click the line or shape outline.

Reshaping using the Selection tool

To reshape a line or shape outline, you can drag any point on a line using the Selection tool. The
pointer changes to indicate what type of reshaping it can perform on the line or fill.
Flash adjusts the curve of the line segment to accommodate the new position of the moved point.
If the repositioned point is an end point, you can lengthen or shorten the line. If the repositioned
point is a corner, the line segments forming the corner remain straight as they become longer
or shorter.
When a corner appears next to the pointer, you can change an end point. When a curve appears next to
the pointer, you can adjust a curve.
Some brush stroke areas are easier to reshape if you view them as outlines.
If you are having trouble reshaping a complex line, you can smooth it to remove some of its
details, making reshaping easier. Increasing the magnification can also make reshaping easier and
more accurate; see “Optimizing curves” on page 99 or “Using the Stage” in Getting Started with
Flash.
To reshape a line or shape outline using the Selection tool:
1.
Select the Selection tool.
2.
Do one of the following:
Drag from any point on the segment to reshape it.
Control-drag (Windows) or Option-drag (Macintosh) a line to create a new corner point.
Reshaping lines and shape outlines 97

Straightening and smoothing lines

You can reshape lines and shape outlines by straightening or smoothing them.
Note: You can adjust the degree of automatic smoothing and straightening by specifying
preferences for drawing settings. See “Specifying drawing settings” on page 103.
Straightening makes small straightening adjustments to lines and curves you have already drawn.
It has no effect on already straight segments.
You can also use the straightening technique to make Flash recognize shapes. If you draw any
oval, rectangular, or triangular shapes with the Recognize Shapes option turned off, you can use
the Straightening option to make the shapes geometrically perfect. (For information on the
Recognize Shapes option, see “Specifying drawing settings” on page 103.) Shapes that are
touching, and thus connected to other elements, are not recognized.
Shape recognition turns the top shapes into the bottom shapes.
Smoothing softens curves and reduces bumps or other variations in a curve’s overall direction. It
also reduces the number of segments in a curve. Smoothing is relative, however, and has no effect
on straight segments. It is particularly useful when you are having trouble reshaping a number of
very short curved line segments. Selecting all the segments and smoothing them reduces the
number of segments, producing a gentler curve that is easier to reshape.
Repeated application of smoothing or straightening makes each segment smoother or straighter,
depending on how curved or straight each segment was originally.
To smooth the curve of each selected fill outline or curved line:
Select the Selection tool and click the Smooth modifier in the Options section of the Tools
panel, or select Modify > Smooth.
To make small straightening adjustments on each selected fill outline or curved line:
Select the Selection tool and click the Straighten modifier in the Options section of the Tools
panel, or select Modify > Shape > Straighten.
To use shape recognition:
Select the Selection tool and click the Straighten modifier, or select Modify >
Shape > Straighten.
98 Chapter 5: Drawing

Optimizing curves

Another way to smooth curves is to optimize them. This refines curved lines and fill outlines by
reducing the number of curves used to define these elements. Optimizing curves also reduces the
size of the Flash document (FLA file) and the exported Flash application (SWF file). As with the
Smooth or Straighten modifiers or commands, you can apply optimization to the same elements
multiple times.
To optimize curves:
1.
Select the drawn elements to be optimized and select Modify > Optimize.
2.
In the Optimize Curves dialog box, drag the Smoothing slider to specify the degree of smoothing.
The exact results depend on the curves selected. Generally, optimizing produces fewer curves, with less resemblance to the original outline.
3.
Set additional options:
Use Multiple Passes repeats the smoothing process until no further optimization can
be accomplished; this is the same as repeatedly selecting Optimize with the same elements selected.
Show Totals Message displays an alert box that indicates the extent of the optimization when
smoothing is complete.
4.
Click OK.

Erasing

Erasing with the Eraser tool removes strokes and fills. You can quickly erase everything on the
Stage, erase individual stroke segments or filled areas, or erase by dragging.
You can customize the Eraser tool to erase only strokes, only filled areas, or only a single filled
area. The Eraser tool can be either round or square, and it can have one of five sizes.
To quickly delete everything on the Stage:
Double-click the Eraser tool.
To remove stroke segments or filled areas:
1.
Select the Eraser tool, and then click the Faucet modifier.
2.
Click the stroke segment or filled area that you want to delete.
To erase by dragging:
1.
Select the Eraser tool.
2.
Click the Eraser Mode modifier and select an erasing mode:
Erase Normal erases strokes and fills on the same layer.
Erase Fills erases only fills; strokes are not affected.
Erase Lines erases only strokes; fills are not affected.
Erasing 99
Erase Selected Fills erases only the currently selected fills and does not affect strokes, selected
or not. (Select the fills you want to erase before using the Eraser tool in this mode.)
Erase Inside erases only the fill on which you begin the eraser stroke. If you begin erasing from
an empty point, nothing is erased. Strokes are unaffected by the eraser in this mode.
3.
Click the Eraser Shape modifier and select an eraser shape and size. Make sure that the Faucet modifier is not selected.
4.
Drag on the Stage.

Modifying shapes

You can modify shapes by converting lines to fills, expanding the shape of a filled object, or
softening the edges of a filled shape by modifying the curves of the shape.
The Convert Lines to Fills feature changes lines to fills, which allows you to fill lines with
gradients or to erase a portion of a line. The Expand Shape and Soften Edges features allow you to
expand filled shapes and blur the edges of shapes.
The Expand Fill and Soften Fill Edges features work best on small shapes that do not contain
many small details. Applying Soften Edges to shapes with extensive detail can increase the file size
of a Flash document and the resulting SWF file.
To convert lines to fills:
1.
Select a line or multiple lines.
2.
Select Modify > Shape > Convert Lines to Fills.
Selected lines are converted to filled shapes. Converting lines to fills can make file sizes larger, but it can also speed up drawing for some animations.
To expand the shape of a filled object:
1.
Select a filled shape. This command works best on a single filled color shape with no stroke.
2.
Select Modify > Shape > Expand Fill.
3.
In the Expand Path dialog box, enter a value in pixels for Distance and select Expand or Inset for Direction. Expand enlarges the shape, and Inset reduces it.
To soften the edges of an object:
1.
Select a filled shape.
Note: This feature works best on a single filled shape that has no stroke.
2.
Select Modify > Shape > Soften Fill Edges.
3.
Set the following options:
Distance is the width, in pixels, of the soft edge.
Number of Steps controls how many curves are used for the soft edge effect. The more steps
you use, the smoother the effect. Increasing steps also creates larger files and slows drawing.
Expand or Inset controls whether the shape is enlarged or reduced to soften the edges.
100 Chapter 5: Drawing
Loading...