Mega Code Archive

 
Categories / Flex / Components
 

Retrieving the current color of the TextArea programmatically

<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"     backgroundColor="0xFFFFFF">     <mx:Script>                  [Bindable]         public var currentColor:Number;         public function changeColor():void         {             myTextArea.setStyle("backgroundColor",myCP.selectedColor);             currentColor= myTextArea.getStyle("backgroundColor");         }            </mx:Script>     <mx:TextArea id="myTextArea" text="My Color is {currentColor}" />     <mx:Label text="Change the Text Area's color:" />     <mx:ColorPicker id="myCP" change="changeColor()" /> </mx:Application>