Use hexadecimal format or the VGA color name : StyleManager « Style « Flex






Use hexadecimal format or the VGA color name

Use hexadecimal format or the VGA color name
         
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    creationComplete="initApp()">
    <mx:Script>
        public function initApp():void {
            StyleManager.getStyleDeclaration("Button").setStyle("themeColor",0x0066CC);
            StyleManager.getStyleDeclaration("Button").setStyle("color","Blue");
        }
        public function changeStyles(e:Event):void {
            e.currentTarget.setStyle("themeColor", 0xFF0099);
            e.currentTarget.setStyle("color", "Red");
        }
      </mx:Script>
    <mx:Button id="myButton" label="Click Here" click="changeStyles(event)" />
</mx:Application>

   
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.To remove a CSSStyleDeclaration object, use StyleManager.clearStyleDeclaration()To remove a CSSStyleDeclaration object, use StyleManager.clearStyleDeclaration()
2.Use StyleManager.loadStyleDeclarations() to load CSS-based SWF file at run timeUse StyleManager.loadStyleDeclarations() to load CSS-based SWF file at run time
3.Adding global CSS styles with StyleManagerAdding global CSS styles with StyleManager
4.Set the fontSize style to 15 and the color to 0x9933FF on all Button controls in the Spark namespaceSet the fontSize style to 15 and the color to 0x9933FF on all Button controls in the Spark namespace
5.Loadng a style sheet when you click the buttonLoadng a style sheet when you click the button
6.Use StyleManager to apply styles to all classes or specified classesUse StyleManager to apply styles to all classes or specified classes
7.Load and unload style with StyleManagerLoad and unload style with StyleManager
8.ColorFormat StyleManagerColorFormat StyleManager
9.Store selectorss names that are registered with the StyleManager in an Array.Store selectorss names that are registered with the StyleManager in an Array.
10.Color Format with StyleManagerColor Format with StyleManager
11.Using Embedded gif image with StyleManagerUsing Embedded gif image with StyleManager
12.Compare Color value after convert color value to string value with Color.toString()Compare Color value after convert color value to string value with Color.toString()