
Creating custom behaviors
97
To create a custom behavior:
1.
Using an XML editor, create a new XML file, and name it appropriately for the behavior
you intend to create.
2.
Enter a category name.
This creates a category in the Behaviors panel under which the behavior is listed.
<behavior_definition dialogID="Trigger-dialog" category="
myCategory
"
authoringEdition="pro" name="
behaviorName
" >
3.
Enter a name for the behavior.
This parameter defines the name that will be listed in the Behaviors panel.
<behavior_definition dialogID="Trigger-dialog" category="
myCategory
"
authoringEdition="pro" name="
behaviorName
" >
4.
If the behavior relies on features available in only the Professional edition of Flash 8, specify
pro
for the
authoringEdition
parameter.
5.
(Optional) If your custom behavior require a dialog box, enter parameters using the
<properties>
and
<dialog>
tags.
To learn about the tags and parameters used to create your own custom dialog boxes, see
Appendix B, “XML to UI.”
6.
In the
<actionscript>
tag, insert the ActionScript code to create the behavior you want
to create.
If you are new to ActionScript, see
Learning ActionScript 2.0 in Flash
.
For example:
<actionscript>
<![CDATA[
// Trigger Data Source Behavior
// Macromedia 2003
$TARGET$.trigger();
]]>
</actionscript>
7.
Save the file.
8.
Test the behavior.
For information on behaviors available in Flash, see
“Controlling instances with
behaviors” on page 94
.
NO
TE
You may want to open an existing behavior’s XML file and save it using a new
filename. This gives you a template with which to create your custom behavior.
Содержание FLASH 8-USING 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...