Mega Code Archive

 
Categories / Flex / Style
 

Class selector names must start with a period when using getStyleDeclaration()

<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">     <mx:Style>     .myFontStyle {       fontSize: 15;       color: #9933FF;     }     </mx:Style>     <mx:Script>     public function changeStyles(e:Event):void {          StyleManager.getStyleDeclaration('.myFontStyle').setStyle('color',0x0000CC);     }   </mx:Script>     <mx:Button id="myButton" label="Click Here" styleName="myFontStyle" click="changeStyles(event)"/> </mx:Application>