ColorPicker Events : ColorPicker « Components « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Components » ColorPickerScreenshots 
ColorPicker Events
ColorPicker Events
       

<!--
Code from Flex Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1proper attribution to Adobe is given as the owner of the user guide; and 
  (2any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->



<!-- controls\colorpicker\CPEvents.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx">
    <fx:Script>
         
        //Import the event classes. 
        import mx.events.DropdownEvent; 
        import mx.events.ColorPickerEvent; 
        [Bindable
        public var simpleDP:Array = ['0x000000', '0xFF0000', '0xFF8800', 
            '0xFFFF00', '0x88FF00', '0x00FF00', '0x00FF88', '0x00FFFF', 
            '0x0088FF', '0x0000FF', '0x8800FF', '0xFF00FF', '0xFFFFFF']; 
        public function openEvt(event:DropdownEvent):void 
             forChange.text="Opened"
        
        public function changeEvt(event:ColorPickerEvent):void 
           forChange.text="Selected Item: " + event.currentTarget.selectedItem + " Selected Index: " + event.currentTarget.selectedIndex; 
        
      
    </fx:Script>
    <mx:VBox>
        <mx:TextArea id="forChange" width="150" />
        <mx:ColorPicker id="cp" dataProvider="{simpleDP}" open="openEvt(event);"
            change="changeEvt(event);" />
    </mx:VBox>
</s:Application>

   
    
    
    
    
    
    
  
Related examples in the same category
1.ColorPicker change eventColorPicker change event
2.Get current selected color from ColorPickerGet current selected color from ColorPicker
3.Set color for ColorPickerSet color for ColorPicker
4.Add an event listener for a change event and an open event to ColorPickerAdd an event listener for a change event and an open event to ColorPicker
5.ColorPicker uses an Array of Objects with three fields: color, label, and descript.ColorPicker uses an Array of Objects with three fields: color, label, and descript.
6.Bind HBox backgroundColor to ColorPicker colorValueBind HBox backgroundColor to ColorPicker colorValue
7.GridItem Label, ColorPickerGridItem Label, ColorPicker
8.Use ControlBar to wrap ColorPicker and Button
9.Change panel style in ColorPicker change eventChange panel style in ColorPicker change event
10.Use a ColorPicker to Set Canvas ColorUse a ColorPicker to Set Canvas Color
11.Populate a ColorPicker with a simple array of colors.Populate a ColorPicker with a simple array of colors.
12.A ColorPicker uses an Array of Objects with three fields: color, label, and descriptA ColorPicker uses an Array of Objects with three fields: color, label, and descript
13.ColorPicker with Custom Field NamesColorPicker with Custom Field Names
ww___w_._j___a_v_a_2s_.__com___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.