Adding global CSS styles with StyleManager
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initStyle();">
<mx:Script>
import mx.styles.StyleManager;
private function initStyle():void
{
StyleManager.getStyleDeclaration("global").setStyle("textDecoration", "underline");
StyleManager.getStyleDeclaration("global").setStyle("fontFamily","Arial");
StyleManager.getStyleDeclaration("global").setStyle("fontSize",12);
StyleManager.getStyleDeclaration("global").setStyle("fontStyle","italic");
StyleManager.getStyleDeclaration("global").setStyle("fontWeight","bold");
}
</mx:Script>
<mx:Panel title="test" width="261" height="178">
<mx:Label text="This is a dummy text" />
</mx:Panel>
</mx:Application>
Related examples in the same category