Setting And Getting Styles

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Label id="myLabel" text="Hello World" fontSize="10"/>
<mx:Button label="Change Font Size" click="myLabel.setStyle('fontSize', 18)"/>
<mx:Button label="Get Font Size" click="myLabel.text=myLabel.getStyle('fontSize')"/>
<mx:Label text="{'Current font size: ' + myLabel.getStyle('fontSize')}"/>
</mx:Application>
Related examples in the same category