
98
Using Symbols, Instances, and Library Assets
Best practices for using behaviors
Behaviors are prewritten code snippets that can be instantly added to parts of a FLA file. The
introduction of behaviors has added to the complexity of determining best practices in Flash,
because the way some behaviors are added does not follow typical and ideal workflows. Many
developers usually enter ActionScript either into one or several frames on the main Timeline
or in external ActionScript files, which is a good practice to follow. However, when you use
behaviors, sometimes code is placed directly on symbol instances (such as buttons, movie
clips, or components) instead of being placed on the Timeline.
Behaviors are convenient, save substantial time, and can be useful for novice Flash and
ActionScript users. Before you start using behaviors, take a close look at how you want to
structure your FLA file:
■
What behaviors do you need for your project?
■
What code do the behaviors contain?
■
How are you are going to use and implement behaviors?
■
What other ActionScript do you need to add?
If you carefully plan a document that uses behaviors, you can avoid problems that could be
created by decentralizing your ActionScript.
For more information, see the following topics:
■
“Comparing timeline code with object code” on page 98
■
“Using behaviors” on page 99
■
“Being consistent” on page 100
■
“Being courteous” on page 101
Comparing timeline code with object code
Planning a project and organizing a document or application cannot be underestimated,
particularly when you are creating large involved projects or working in teams. This is why the
placement of ActionScript—often what makes the project work—is important.
Содержание FLASH 8-FLASH
Страница 1: ...Using Flash ...
Страница 12: ...12 Contents ...
Страница 110: ...110 Using Symbols Instances and Library Assets ...
Страница 128: ...128 Working with Color Strokes and Fills ...
Страница 156: ...156 Drawing ...
Страница 190: ...190 Working with Text ...
Страница 224: ...224 Working with Graphic Objects ...
Страница 270: ...270 Creating Motion ...
Страница 310: ...310 Working with Video ...
Страница 362: ...362 Working with Screens Flash Professional Only ...
Страница 386: ...386 Creating Multilanguage Text ...
Страница 454: ...454 Data Integration Flash Professional Only ...
Страница 500: ...500 Publishing ...
Страница 534: ...534 Creating Accessible Content ...