Use a ColorPicker to Set Canvas Color : 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 
Use a ColorPicker to Set Canvas Color
Use a ColorPicker to Set Canvas Color
       
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">

    <mx:Canvas id="cnv" width="450" height="450" backgroundColor="#eeaeaea">
        <mx:ColorPicker id="pckr" right="10" top="10" change="setColor(event)"/>
    </mx:Canvas>
    <mx:Script>
        
            import mx.events.ColorPickerEvent;

            private function setColor(evt:ColorPickerEvent):void{
                cnv.setStyle("backgroundColor",evt.color)
            }
      
    </mx:Script>
</mx: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.Populate a ColorPicker with a simple array of colors.Populate a ColorPicker with a simple array of colors.
11.ColorPicker EventsColorPicker Events
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
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.