Load style from swf file : SWF Style « Style « Flex






Load style from swf file

             

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="initializeHandler(event)">
    <mx:Script>
        
            private var _currentStyle:String;

            private function initializeHandler(event:Event):void {
                StyleManager.loadStyleDeclarations("a.swf");
                _currentStyle = "a.swf";
            }

            private function clickHandler(event:Event):void {
                StyleManager.unloadStyleDeclarations(_currentStyle);
                StyleManager.loadStyleDeclarations(stylesOptions.value.toString(  ));
                _currentStyle = stylesOptions.value as String;
            }
      
    </mx:Script>
    <mx:ComboBox id="stylesOptions" toolTip="Select a Style Sheet">
        <mx:dataProvider>
            <mx:ArrayCollection>
                <mx:String>a.swf</mx:String>
                <mx:String>b.swf</mx:String>
            </mx:ArrayCollection>
        </mx:dataProvider>
    </mx:ComboBox>
    <mx:Button label="Change Style" click="clickHandler(event)" />
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Load three style SWF filesLoad three style SWF files
2.Load three style SWF files, but does not apply them until the third one is loaded
3.Load and unload a style SWF when you toggle the check boxLoad and unload a style SWF when you toggle the check box