using the setStyle() method from event target to change style for controls : Style Event « Style « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Style » Style EventScreenshots 
using the setStyle() method from event target to change style for controls
using the setStyle() method from event target to change style for controls
           

<?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",0x6666CC);
            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.Style error event handlerStyle error event handler
2.Style complete event handlerStyle complete event handler
3.Styles Event
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.