Mega Code Archive

 
Categories / Flex / Components
 

Bind HBox backgroundColor to ColorPicker colorValue

<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">     <mx:Script>         [Bindable]         public var colorValue:int = 0x333999;         public function changeHBoxStyle():void {             colorValue = cp.selectedColor;         }       </mx:Script>     <mx:HBox width="100" height="100" backgroundColor="{colorValue}" />     <mx:ColorPicker id="cp" showTextField="true" change="changeHBoxStyle()" selectedColor="0x333999" /> </mx:Application>