Creating Components > Adding a description to the component > Adding an XML description |
![]() ![]() ![]() |
Adding an XML description
As an alternative to a text description, you can add an XML description. You create a separate XML document to add a custom action to the Actions toolbox and another custom action to the Reference panel. You place the XML document with the custom actions in the Configuration/ActionsPanel/CustomActions folder in the Macromedia Flash MX application folder.
Custom actions are enclosed and nested within the tags <customactions>
and </customactions>
.
The custom action to place the component inside the Actions panel toolbox should be enclosed in the tags <actionspanel>
and </actionspanel>
. If you are placing the component inside a subfolder in the Actions panel, the action should also include tags for the subfolder. Inside the <actionspanel>
tags, the action should include a string name
tag with the component symbol name, a tipText
tag with tooltip text, and a text
tag with the component name formatted as an ActionScript functionthe component name followed by empty parentheses, ().
For example, this is the Actions panel custom action code for the component in the "Creating components in Macromedia Flash MX" tutorial on the Flash Support Center:
<actionspanel> <string name ="component" tipText = "Pulsating button" text = "component()"> </actionspanel>
Actions for the Reference panel are enclosed inside the tags <reference>
and </reference>
. They should the path to the component in the Actions toolbox and description text for the component, as well as a title for the description, if desired. The title and description text can use any of the HTML tags supported in Flash HTML fields (including <A>
, <B>
, <FONT COLOR>
, <FONT FACE>
, <FONT SIZE>
, <I>
, <P>
, and <U>)
.
The following is an example of Reference panel custom action code for a component:
<reference path="component"> <p class="titleStyle">Custom Component</p> <p>Blue pulsating button with text label.</p> </reference>
The two actions together are nested inside the <customactions>
tags in the XML document.
To add an XML description for a component:
1 |
Use an HTML editor such as Macromedia Dreamweaver to create an XML document with the custom actions for the Actions toolbox and the Reference panel, following the syntax described above. |
2 |
Add the XML document to the Configuration/ActionsPanel/CustomActions folder in the following location. |
For Windows operating systems: |
|
![]() |
Windows 2000 or XP: C:\Documents and Settings\[user name]\Application Data\Macromedia\Flash MX\ |
![]() |
Windows 98 or ME: C:\Windows\Application Data\Macromedia\Flash MX\ |
![]() |
Windows NT: Windows directory\profiles\user\Application Data\Macromedia\Flash MX\ |
For Macintosh operating systems: |
|
![]() |
Macintosh OS X: Hard Drive/Users/Library/Application Support/Macromedia/FlashMX/ |
![]() |
Macintosh System 9.x, single user: Hard Drive/System folder/Application Support/Macromedia/Flash MX/ |
![]() |
Macintosh System 9.x, multiple users: Hard Drive/Users/[user name]/Documents/Macromedia/FlashMX/ |
3 |
Restart Flash. |
4 |
Choose Window > Reference. |
The component entry should appear in the Actions list in the left pane of the Reference panel. |
|
5 |
Click the component entry. |
The component title and description should appear in the right pane of the Reference panel. Now you need to set the Reference panel description in the Component Definition dialog box. |
|
6 |
Select the component in the Library panel (Window > Library). |
7 |
Choose Component Definition from the Library options menu. |
8 |
In the Component Definition dialog box, click the Set button next to the Description text box. |
9 |
In the Component Description dialog box, select Description Is a Reference Panel Item. |
10 |
Type the name of the component file in the Reference Panel Item text box, or scroll in the Actions toolbox list and select the component from the list. |
11 |
Click OK to close the Component Description dialog box. |
The (Reference Panel) identifier and the component name appear in the Description text box. If you previously entered a plain text description, it is deleted. |
|
12 |
Click OK to close the Component Definition dialog box. |
The XML description is viewable in the Reference panel after you add the component files to your Macromedia Flash MX application folder. See Making the component available for Flash documents. The component name appears in the left pane of the Reference panel, and the description appears in the right pane when you click the component name. |
|
13 |
Save the file. |
![]() ![]() ![]() |