GhostWire ColorPicker - Usage
Using the GhostWire ColorPicker component
Just drag and drop an instance of the GhostWire ColorPicker from the components panel onto the stage. Edit the component parameters of the instance to suit your requirements. For best results, it is recommended that you add the following actionscripts to your application:
Stage.scaleMode = "noScale";
Stage.align = "LT";
This is to ensure that the component is able to compute the correct position of the popup palette.
---
How do I change the color palette that is shown in the popup?
You can change the palette of selectable colors of a GhostWire ColorPicker instance by setting its 'palette' property via actionscript during runtime. This property is an array containing the values of the colors in the palette. By changing the 'palette' property and adjusting the 'rowCount' property, you can have ColorPickers that look very differently. This is useful if you wish to limit users to a selection of colors. The following example shows how to create a popup palette with 3 colors - red, green, blue - rendered in a single row:
myColorPicker.rowCount = 1;
myColorPicker.palette = [0xFF0000,0x00FF00,0x0000FF];
---
How do I remove the inputfield in the popup?
If you wish to prevent users from entering their own color values, therefore limiting them only to the selection of colors in the provided palette, you can do so by setting the properties 'fieldWidth' and 'fieldHeight' to zero. Example:
myColorPicker.fieldHeight = 0;
myColorPicker.fieldWidth = 0;
---
How do I remove the colored square that is positioned next to the inputfield?
This square changes color as you move the cursor over the selection of colors, serving as a form of preview for the color that you would be selecting. This square can be removed by setting the properties 'selWidth' and 'selHeight' to zero, just like for the inputfield.
---
How do I create custom reactions when a color has been selected?
The component has an event handler called 'onChange'. This event is triggered whenever the color in the ColorPicker has been changed, such as when the user picks a new color from the popup palette. Example (code is placed on the timeline, NOT on any movieclip instance):
myColorPicker.onChange = function(value)
{
// value of the color just selected will be passed as a single parameter
// handle 'value' here
}
Flash Components
Button :: CheckBox :: CollapsibleMenu :: CollapsiblePane :: ColorPicker :: ComboBox :: ContextMenu :: DialogBox :: InputField :: ListBox :: Loader :: Menu :: SlideMenu :: NumericBox :: Panel :: ProgressBar :: RadioButton :: ScrollBar :: ScrollPane :: SlidePane :: Slider :: TabView :: TextArea :: TreeView :: Window
See also
Documentation :: FAQs :: Testimonials
|