Mega Code Archive

 
Categories / Flex / Style
 

Cast target to a UIComponent before calling the setStyle() method

<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">     <mx:Script>     import mx.core.UIComponent;     private function myEventHandler(e:Event):void {         UIComponent(e.currentTarget).setStyle("color", "red");     }   </mx:Script>     <mx:Button id="b1" label="Click Me" click="myEventHandler(event)" /> </mx:Application>