Changing CSS Selectors
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Script>
private function setLabelFont():void
{
var style:CSSStyleDeclaration = new CSSStyleDeclaration();
style.setStyle("fontSize", 18);
style.setStyle("fontWeight", "bold");
StyleManager.setStyleDeclaration("Label", style, true);
}
</mx:Script>
<mx:Style>
@namespace mx "http://www.adobe.com/2006/mxml";
mx|Label {
font-size:12;
}
</mx:Style>
<mx:Label text="Hello World"/>
<mx:Button label="Change Label Font" click="setLabelFont()"/>
</mx:Application>
Related examples in the same category