Developer Network Home  Help 

YDN Flash Developer Center Astra Flex Components ColorSliderPicker
Flash Developer Center

ASTRA ColorSliderPicker

ColorSliderPicker is a user interface component for Flex that allows the user to pick a color value. It combines a set of sliders where each slider represents a component of a colorspace. For example, a ColorSliderPicker displaying an RGB color includes a red slider, a green slider, and a blue slider.

Getting Started: ColorSliderPicker for Flex 3

Similar to other Flex components, you can create a ColorSliderPicker by creating an instance with MXML or by using ActionScript to create an instance dynamically.

Initializing an ColorSliderPicker with MXML

Similar to other Flex components, you can create an ColorSliderPicker with MXML. First, you must import the yahoo namespace for the Astra Flex controls. Simply add xmlns:yahoo="http://www.yahoo.com/astra/2006/mxml" to your application or MXML component declaration.

To programmatically set the color of the ColorSliderPicker control, use the selectedColor property. It accepts a standard ActionScript uint color value.

Screen capture of ColorSliderPicker MXML Example

To see a live example, please install Adobe Flash Player version 9 or higher.

Download the MXML example file.

Initializing an ColorSliderPicker with ActionScript

Alternatively, you can use ActionScript to instantiate an ColorSliderPicker control. Be sure the import the ColorSliderPicker class first, then simply create an instance and add it to the display list using addChild().

Like in MXML, you can set the selectedColor property using a uint value.

Screen capture of ColorSliderPicker ActionScript Example

To see a live example, please install Adobe Flash Player version 9 or higher.

Download the MXML example file.

For additional topics, please read Using ColorSliderPicker, or take a look at the Examples section for functional demonstrations. The ActionScript 3.0 Class Reference contains full details on every property, method, and style available to the ColorSliderPicker component.