EasyManua.ls Logo

MACROMEDIA FLASH 8-USING FLASH - Page 97

MACROMEDIA FLASH 8-USING FLASH
678 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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.
NOTE
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.

Table of Contents

Related product manuals