Colorchip - MACROMEDIA FLASH MX 2004-USING FLASH Use Manual

Hide thumbs Also See for FLASH MX 2004-USING FLASH:
Table of Contents

Advertisement

<colorchip>
Availability
Flash MX 2004.
Usage
<colorchip
id="myID"
color="myColor"/>
Attributes
String; represents a unique identification string that is used by the extensibility features to
id
identify the control and access the value it returns.
Number; hex number representing a color used as default value.
color
Child tags
None.
Parent tag
<dialog>, <hbox>,
Description
Control tag; Creates a color picker control (this is not part of the XUL standard). This tag is
specific to Flash and is not a part of the XUL tag set.
Example
The following example uses the JavaScript API to create a new command that appears on the
Commands menu. Create two files, as described in this section, and place them in your
Commands folder in your user-level configuration folder. For more information, see
"Configuration folders installed with Flash" in Getting Started with Flash.
First, create a file named setcolor.jsfl and place it in your Commands folder. Place the following
code into the file and save the file:
// Create an XML to UI dialog box using the XML definition
// in the setcolor.xml file
var setcolorDlg = fl.getDocumentDOM().xmlPanel( fl.configURI + "Commands/
setcolor.xml" );
if (setcolorDlg.dismiss == "accept") {
fl.getDocumentDOM().setFillColor(setcolorDlg.fillColor);
fl.getDocumentDOM().setStrokeColor(setcolorDlg.strokeColor);
}
Second, create a file named setcolor.xml and place it in your Commands folder. Place the
following code into the file and save the file:
<dialog id="setcolor-dialog" title="Set Color" buttons="accept, cancel">
<grid>
<columns>
<column/>
452
Appendix B: XML to UI
,
<row>
<vbox>

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents