Create a new CSSStyleDeclaration object : CSSStyleDeclaration « 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 » CSSStyleDeclarationScreenshots 
Create a new CSSStyleDeclaration object
Create a new CSSStyleDeclaration object
   

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    creationComplete="initApp()">
    <mx:Script>
    import mx.styles.StyleManager;
    private var myDynStyle:CSSStyleDeclaration;
    private function initApp():void {
        myDynStyle = new CSSStyleDeclaration('myDynStyle');
        myDynStyle.setStyle('color', 'blue');
        myDynStyle.setStyle('fontFamily', 'georgia');
        myDynStyle.setStyle('themeColor', 'green');
        myDynStyle.setStyle('fontSize', 40);
        StyleManager.setStyleDeclaration("Button",myDynStyle, true);
    }
  </mx:Script>
    <mx:Button id="myButton" label="Click Me" />
</mx:Application>

   
    
    
  
Related examples in the same category
1.Set color, font family, theme color, font size with CSSStyleDeclarationSet color, font family, theme color, font size with CSSStyleDeclaration
2.A CSSStyleDeclaration object for the Spark and MX Button controlsA CSSStyleDeclaration object for the Spark and MX Button controls
w___w_w__.j__ava__2_s___._c__o___m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.