Using setStyle to programmatically manipulate a style property

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
backgroundColor="0xFFFFFF">
<mx:Script>
public function changeColor():void
{
myTextArea.setStyle("backgroundColor",0xFF0000);
}
</mx:Script>
<mx:TextArea text="Text Area" id="myTextArea" />
<mx:Button click="changeColor()" label="Try Me" />
</mx:Application>
Related examples in the same category