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
Loading...
+ 464 hidden pages