Tài liệu Using Flash MX doc - Pdf 90

macromedia

®
Using Flash
Trademarks
Afterburner, AppletAce, Attain, Attain Enterprise Learning System, Attain Essentials, Attain Objects for Dreamweaver,
Authorware, Authorware Attain, Authorware Interactive Studio, Authorware Star, Authorware Synergy, Backstage, Backstage
Designer, Backstage Desktop Studio, Backstage Enterprise Studio, Backstage Internet Studio, Design in Motion, Director,
Director Multimedia Studio, Doc Around the Clock, Dreamweaver, Dreamweaver Attain, Drumbeat, Drumbeat 2000, Extreme
3D, Fireworks, Flash, Fontographer, FreeHand, FreeHand Graphics Studio, Generator, Generator Developer’s Studio, Generator
Dynamic Graphics Server, Knowledge Objects, Knowledge Stream, Knowledge Track, Lingo, Live Effects, Macromedia,
Macromedia M Logo & Design, Macromedia Flash, Macromedia Xres, Macromind, Macromind Action, MAGIC, Mediamaker,
Object Authoring, Power Applets, Priority Access, Roundtrip HTML, Scriptlets, SoundEdit, ShockRave, Shockmachine,
Shockwave, Shockwave Remote, Shockwave Internet Studio, Showcase, Tools to Power Your Ideas, Universal Media, Virtuoso,
Web Design 101, Whirlwind and Xtra are 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, servicemarks, or tradenames of Macromedia, Inc. or other entities and may be registered in
certain jurisdictions including internationally.
Third-Party Information
Speech compression and decompression technology licensed from Nellymoser, Inc. (www.nellymoser.com).
Sorenson™ Spark™ video compression and decompression technology licensed from
Sorenson Media, Inc.
This guide contains links to third-party Web sites 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 Web site 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.
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 PARTIC-
ULAR 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

Artwork in Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Animation in Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Interactive movies in Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Application development in Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
The Stage and workspace. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Creating a new document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Setting preferences in Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Using the Property inspector to change document attributes . . . . . . . . . . . . . . . . . . . . . 24
Customizing keyboard shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Using scenes and the Scene panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Using the Timeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Using frames and keyframes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Using layers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Previewing and testing movies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Using the Movie Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Speeding up movie display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Saving Flash documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Configuring a server for the Flash Player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Printing Flash documents as you edit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
CHAPTER 2
Working with Flash assets
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Assets and asset management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Panels and the Property inspector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Using the toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Using context menus. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Using the library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
About components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Contents4
CHAPTER 3

Placing artwork into Flash. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Working with imported bitmaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Importing video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
CHAPTER 6
Adding Sound
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Importing sounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Adding sounds to a movie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Adding sounds to buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Using sounds with Sound objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Using the sound-editing controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Starting and stopping sounds at keyframes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
About the onSoundComplete event. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Compressing sounds for export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
CHAPTER 7
Working with Graphic Objects
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Selecting objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Grouping objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Moving, copying, and deleting objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Contents 5
Stacking objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Transforming objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Flipping objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Restoring transformed objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Aligning objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Breaking apart groups and objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
CHAPTER 8
Working with Text
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

Creating keyframes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Representations of animations in the Timeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
About frame rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Extending still images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Distributing objects to layers for tweened animation . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Tweening instances, groups, and type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Tweening motion along a path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Tweening shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Using shape hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Creating frame-by-frame animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Editing animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Using mask layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Contents6
CHAPTER 11
Writing Scripts with ActionScript
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Using the Actions panel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Using an external text editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
About syntax highlighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Setting Actions panel preferences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Using code hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Assigning actions to a frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Assigning actions to a button. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Assigning actions to a movie clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
CHAPTER 12
Understanding the ActionScript Language
. . . . . . . . . . . . . . . . . . . . . . . . . . 203
Differences between ActionScript and JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
About scripting in ActionScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
ActionScript terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209

Deleting components from Flash documents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
About component label size and component width and height . . . . . . . . . . . . . . . . . . 296
The CheckBox component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
The ComboBox component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Contents 7
The ListBox component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
The PushButton component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
The RadioButton component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
The ScrollBar component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
The ScrollPane component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Writing change handler functions for components . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
Customizing component colors and text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Customizing component skins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Creating forms using components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
CHAPTER 16
Connecting with External Sources
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Sending and loading variables to and from a remote source . . . . . . . . . . . . . . . . . . . . 319
Sending messages to and from the Flash Player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
CHAPTER 17
Creating Printable Movies
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Printing from the Flash Player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Adding a Print action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
Printing from the Flash Player context menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
About publishing a movie with printable frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
CHAPTER 18
Creating Accessible Content
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
About the Macromedia Flash Accessibility Web page. . . . . . . . . . . . . . . . . . . . . . . . . . 341

Exporting
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Exporting movies and images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
About export file formats. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
Updating Flash movies for Dreamweaver UltraDev . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
APPENDIX A
Keyboard shortcuts
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Navigation keys. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Action keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Mouse actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Menu items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
APPENDIX B
Operator Precedence and Associativity
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
APPENDIX C
Keyboard Keys and Key Code Values
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Letters A to Z and standard numbers 0 to 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Keys on the numeric keypad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
Function keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Other keys. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
APPENDIX D
Error Messages
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
INDEX
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
9
INTRODUCTION
Getting Started

Internet Explorer 4 or later (Windows 95, Windows 98,
Windows Me, Windows NT4, Windows 2000, Windows XP, or later).

AOL 7 on Windows, AOL 5 on the Mac OS

Opera 6 on Windows, Opera 5 on the Mac OS
Introduction10
Installing Flash
Follow these steps to install Flash on either a Windows or a Macintosh computer.
To install Flash on a Windows or a Macintosh computer:
1
Insert the Flash CD into the computer’s CD-ROM drive.
2
Do one of the following:

In Windows, choose Start > Run. Click Browse and choose the Flash MX Installer.exe file on
the Flash MX CD. Click OK in the Run dialog box to begin the installation.

On the Macintosh, double-click the Flash MX Installer icon.
3
Follow the onscreen instructions.
4
If prompted, restart your computer.
What’s new in Flash MX
New features in Flash MX enhance the approachability, creativity, and power of Flash. Designers
who require a higher level of control and integration with industry-standard design tools now
have an unparalleled creative application for creating media-rich content.
Powerful new features build on this creativity, giving application developers access to new
capabilities that make Flash MX a robust and exciting application development environment.
Developers can work with advanced scripting and debugging tools, built-in code reference, and

new library symbols is now as easy as dragging and dropping. See “Working with common
libraries” on page 58. The new Resolve Library Conflict dialog box simplifies adding library
symbols to a document that has an existing library symbol with the same name. See “Resolving
conflicts between library assets” on page 168.
Shared library assets
improve Flash movie authoring by letting you share library assets with other
Flash documents, either while authoring, or when a movie is played with the Flash Player. Shared
runtime libraries help you create smaller files and easily make updates to multiple documents
simultaneously by letting your document show library symbols and shared objects that are stored
on an intranet or the Internet. Shared author-time libraries improve your work pace by letting
you track, update, and swap symbols in any Flash document available on your computer or
network. See “Using shared library assets” on page 165.
Workspace enhancements
make the Flash MX workspace more manageable and easier to
understand for new and veteran designers. The most commonly used features now appear in one
context-sensitive Property inspector, eliminating the need to access many other windows, panels,
and dialog boxes. See “Panels and the Property inspector” on page 48. Other frequently used
features now appear in easily collapsible panels that dock and undock as necessary to conserve
screen space. Designers can even save custom panel layouts to personalize their Flash workspace.
See “Using panels” on page 48.
New starter templates
included with Flash MX simplify the creation of new documents by
eliminating many of the common tasks required to start a new document. See “Creating a new
document” on page 21. You can also create your own templates from documents. See “Saving
Flash documents” on page 43.
Color Mixer improvements
make creating, editing, and using colors and gradients easier than ever.
See “Working with solid colors and gradient fills in the Color Mixer” on page 80.
Complete lessons
that address the new features in Flash MX make it easy to become familiar with

enhance the production quality of your movies by letting you
synchronize movie events with the start or end of sound clips. See “About the onSoundComplete
event” under Help > Using Flash.
For the developer
The powerful Flash MX environment includes enhanced scripting and debugging tools, built-in
code reference, and predefined components you can use to rapidly develop rich Web applications.
Enhanced ActionScript
gives you the ability to dynamically load JPEG and MP3 sound files at
runtime, and lets you update your files at any time without having to republish your movie.See
“Placing artwork into Flash” and “Importing sounds” under Help > Using Flash.See “Placing
artwork into Flash” and “Importing sounds” under Help > Using Flash.
Anchor points
enhance navigation in Flash movies by letting users use the Forward and Back
buttons in their browsers to jump from anchor to anchor. See “Using named anchors” on page 33.
The improved ActionScript editor
makes it easier for new and veteran authors to access the full
potential of ActionScript. See “About scripting in ActionScript” on page 204.
Code hints
speed content development of ActionScript by automatically detecting what
command the user is typing and offering hints to reveal the exact syntax of the command. See
“Using code hints” under Help > Using Flash.
Flash components
accelerate Web application development by providing reusable drag-and-drop
interface elements for Flash content, such as list boxes, radio buttons, and scroll bars. See Chapter
15, “Using Components,” on page 289.
The improved debugger
combines the debugging capabilities already in existence with an
ActionScript debugger by allowing you to set breakpoints and single-step through the code as it
executes. See “Te stin g a m ov i e” under Help > Using Flash.
The object model

Performance in the Flash Player is increased as much as 100 times. See the entries for these objects
in the online ActionScript Dictionary in the Help menu.
SWF compression
uses existing Z-lib compression code to improve download times for complex
Flash content. See Chapter 20, “Publishing,” on page 365.
Guide to instructional media
The Flash package contains a variety of media to help you learn the program quickly and become
proficient in creating your own Flash movies. These media include a printed manual, an
expanded electronic version of the manual, online help that appears in your Web browser, a
built-in ActionScript Reference panel, interactive lessons, and a regularly updated Web site. In
addition, there are many third-party resources available to Flash designers and developers.
About the printed and electronic manuals
Information that appears in the printed version of Using Flash is primarily intended for users who
are in their first three to six months of learning Flash. Online lessons and tutorials supplement
this information.
The electronic version of Using Flash contains all of the information in the printed version, as well
as additional chapters with instructions and information for using Flash tools and commands. It
also includes chapters on ActionScript, which explain how to write and create interactions with
the Flash scripting language.
Using Flash Help
Flash Help contains two main sections: Using Flash and the ActionScript Dictionary. For the best
experience with Flash Help, Macromedia strongly recommends that you use a browser with Java
player support, such as Internet Explorer 4.5 or later. Flash Help also supports Netscape
Navigator 6.1 or later on Windows and Macintosh. Running Flash and Flash Help
simultaneously on a Macintosh may require up to 32 MB of memory, depending on your
browser’s memory needs.
Note: The first time you access Flash Help when running Windows XP, you may be prompted to install the Java
player. Follow the onscreen instructions to install the Java player.
To use Flash Help:
1

intermediate Flash users and show how they can be used to quickly create a simple application.
Before taking this tutorial, you should complete the Flash lessons, the Introduction to Flash MX
tutorial, and the Introduction to ActionScript tutorial or be familiar with ActionScript.
Getting Started 15
To start the lessons:
Choose Help > Lessons > Getting Started with Flash.
To start a tutorial, do one of the following:

Choose Help > Tutorials > Introduction to Flash MX.

Choose Help > Tutorials > Introduction to ActionScript.

Choose Help > Tutorials > Introduction to Components.
Using additional Macromedia resources
The Flash Support Center Web site is updated regularly with the latest information on Flash, plus
advice from expert users, advanced topics, examples, tips, and other updates. Check the Web site
often for the latest news on Flash and how to get the most out of the program at
www.macromedia.com/support/flash. Check the Web site often for the latest news on Flash and
how to get the most out of the program at www.macromedia.com/support/flash.
The ActionScript Reference panel provides detailed information on ActionScript syntax and
usage. The hierarchical structure of the information lets you easily scroll down to the specific
information you need.
To display the ActionScript Reference panel:
Choose Window > Reference.
Third-party resources
Macromedia recommends several Web sites with links to third-party resources on Flash.
Macromedia Flash community sites:
www.macromedia.com/support/flash/ts/documents/flash_websites.htm
www.macromedia.com/support/flash/ts/documents/tn4148-flashmaillists.html
Macromedia Flash books:

movie on the Flash Player is similar to viewing a DVD on a DVD player—the Flash Player is the
device used to display the movies you create in the Flash authoring application.
Flash documents, which have the .fla filename extension, contain all the information required to
develop, design, and test interactive content. Flash documents are not the movies the Flash Player
displays. Instead, you publish your FLA documents as Flash movies, which have the .swf filename
extension and contain only the information needed to display the movie.
For an interactive introduction to Flash, choose Help > Lessons > Getting Started with Flash.
Artwork in Flash
Flash provides a variety of methods for creating original artwork and importing artwork from
other applications. You can create objects with the drawing and painting tools, as well as modify
the attributes of existing objects. See Chapter 3, “Drawing,” on page 59 and Chapter 4, “Working
with Color,” on page 77.
You can also import vector graphics, bitmap graphics, and video from other applications and
modify the imported graphics in Flash.See “Using Imported Artwork and Video” under Help >
Using Flash.
Note: You can also import sound files, as

described in “Importing sounds” under Help > Using Flash.
Animation in Flash
Using Flash, you can animate objects to make them appear to move across the Stage and/or
change their shape, size, color, opacity, rotation, and other properties. You can create
frame-by-frame animation, in which you create a separate image for each frame. You can also
create tweened animation, in which you create the first and last frames of an animation and direct
Flash to create the frames in between. See Chapter 10, “Creating Animation,” on page 169.
Chapter 118
You can also use ActionScript, an object-oriented programming language, to create animation in
Flash. See Chapter 12, “Understanding the ActionScript Language,” on page 203.
Interactive movies in Flash
Flash lets you create interactive movies, in which your audience can use the keyboard or the
mouse to jump to different parts of a movie, move objects, enter information in forms, and

To zoom in on a certain element, select the Zoom tool and click the element. To switch the
Zoom tool between zooming in or out, use the Enlarge or Reduce modifiers or Alt-click
(Windows) or Option-click (Macintosh).

To zoom in on a specific area of your drawing, drag a rectangular selection marquee with the
Zoom tool. Flash sets the magnification level so that the specified rectangle fills the window.

To zoom in on or out of the entire Stage, choose View > Zoom In or View > Zoom Out.

To zoom in or out by a specified percentage, choose View > Magnification and select a
percentage from the submenu, or select a percentage from the Zoom control at the lower left
corner of the application window.

To display the contents of the current frame, choose View > Magnification > Show All, or
choose Show All from the Zoom control at the lower left corner of the application window. If
the scene is empty, the entire Stage is displayed.

To display the entire Stage, choose View > Magnification > Show Frame or choose Show Frame
from the Zoom control at the lower left corner of the application window.

To display the work area surrounding the Stage, choose View > Work Area. The work area is
shown in light gray. Use the Work Area command to view elements in a scene that are partly or
completely outside of the Stage. For example, to have a bird fly into a frame, you would
initially position the bird outside of the Stage in the work area.
Moving the view of the Stage
When the Stage is magnified, you may not be able to see all of it. The Hand tool lets you move
the Stage to change the view without having to change the magnification.
To move the Stage view:
1
In the toolbox, select the Hand tool. To temporarily switch between another tool and the

Using guides
You can drag horizontal and vertical guides from the rulers onto the Stage when the rulers are
displayed. You can move guides, lock guides, hide guides, and remove guides. You can also snap
objects to guides, and change guide color and snap tolerance (how close objects must be to snap
to a guide). Draggable guides appear only in the Timeline in which they were created.
To create custom guides or irregular guides, you use guide layers. See “Using guide layers” on page 38.
To display or hide the drawing guides:
Choose View > Guides > Show Guides.
Note: If the grid is visible and Snap to Grid is turned on when you create guides, guides will snap to the grid.
To turn snapping to guides on or off:
Choose View > Guides > Snap to Guides.
Note: Snapping to guides takes precedence over snapping to the grid in places where guides fall between grid lines.
To move a guide:
Use the Arrow tool to drag the guide.
Working in Flash 21
To remove a guide:
With guides unlocked, use the Arrow tool to drag the guide to the horizontal or vertical ruler. For
information on locking and unlocking guides, see the following procedure.
To set guide preferences:
1
Choose View > Guides > Edit Guides.
2
For Color, click the triangle in the color box and select a guide line color from the palette.
The default guide color is green.
3
Select or deselect Show Guides to display or hide guides.
4
Select or deselect Snap to Guides to turn snapping to guides on or off.
5
Select or deselect Lock Guides to lock or unlock guides.

Chapter 122
3
For Frame Rate, enter the number of animation frames to be displayed every second. For
most computer-displayed animations, especially those playing from a Web site, 8 fps (frames
per second) to 12 fps is sufficient. (12 fps is the default frame rate.)
4
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 movie 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 movie 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.
5
To set the background color of your movie, click the triangle in the Background Color box and
select a color from the palette.
6
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. See “Using
rulers” on page 21. (This setting also determines the units used in the Info panel.)
7
Do one of the following:

For Printing Options (Windows only), select Disable PostScript to disable PostScript
output when printing to a PostScript printer. By default, this option is deselected. Select this
option if you have problems printing to a PostScript printer, but keep in mind that this will
slow down printing.

For Selection Options, select or deselect Shift Select to control how Flash handles selection of
multiple elements. When Shift Select is off, clicking additional elements adds them to the
current selection. When Shift Select is on, clicking additional elements deselects other
elements unless you hold down the Shift key.

Select Show Tooltips to display tooltips when the pointer pauses over a control. Deselect this
option if you don’t want to see the tooltips.

For Timeline Options, select Disable Timeline Docking to keep the Timeline from attaching
itself to the application window once it has been separated into its own window. For more
information, see “Using the Timeline” on page 28.

Select Span Based Selection to use span-based selection in the Timeline, rather than the default
frame-based selection (Flash 5 used span-based selection). For more information on span-based
and frame-based selection, see “Working with frames in the Timeline” on page 31.

Select Named Anchor on Scenes to have Flash make the first frame of each scene in a movie a
named anchor. Named anchors let you use the Forward and Back buttons in a browser to jump
from scene to scene in a movie. For more information, see “Using named anchors” on page 33.

For Highlight Color, select Use This Color and select a color from the palette, or select Use
Layer Color to use the current layer’s outline color.

For Font Mapping Default, select a font to use when substituting missing fonts in movies you
open in Flash. See “Substituting missing fonts” on page 145.

For PICT Settings (Macintosh only), for Type, select Objects to preserve data copied to the
Clipboard as vector artwork, or select one of the bitmap formats to convert the copied artwork
to a bitmap. Enter a value for Resolution. Select Include PostScript to include PostScript data.
For Gradients, choose an option to specify gradient quality in the PICT. Choosing a higher
quality increases the time required to copy artwork. Use the Gradients setting to specify
gradient quality when pasting items to a location outside of Flash. When you are pasting within
Flash, the full gradient quality of the copied data is preserved regardless of the Gradient setting.

For FreeHand Text, select Maintain Text as Blocks to keep text editable in a pasted FreeHand file.
To set warning preferences, choose one of the following options:

Select Warn on Save for Macromedia Flash 5 Compatibility to have Flash warn you when you
try to save documents with Flash MX–specific content to a Flash 5 file. This option is selected
by default.

Select Warn on Missing Fonts to have Flash warn you when you open a Flash document that
uses fonts that are not installed on your computer. This option is selected by default.

Select Warn on Loss of Expert Mode Formatting to have Flash warn you of any expert mode
formatting that will be lost when you switch to normal mode in the Actions panel. This option
is selected by default.

Select Warn on Reading Generator Content to have Flash display a red “X” over any Generator
objects, as a reminder that Generator objects are not supported in Flash MX.

Select Warn on Inserting Frames when Importing Content to have Flash alert you when it
inserts frames in your document to accommodate audio or video files that you import.
Using the Property inspector to change document attributes
The Property inspector makes it easy to access and change the most commonly used attributes of
a document. You can make changes to document attributes in the Property inspector without

Shortcut buttons
Shortcuts list
Duplicate Set button
Rename Set button
Delete Set button


Nhờ tải bản gốc
Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status