Load External SWF : SWFLoader « Development « Flex






Load External SWF

Load External SWF
           
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:s="library://ns.adobe.com/flex/spark">
    <mx:Script>
        
            import mx.controls.Alert;
            protected function sampleOpenHandler(event:Event):void {
                Alert.show('open');
            }

            protected function sampleProgressHandler(event:ProgressEvent):void {
                Alert.show(event.bytesLoaded+' of '+event.bytesTotal+' bytes loaded');
            }

            protected function sampleCompleteHandler(event:Event):void {
                Alert.show('complete');
            }
      
    </mx:Script>
    <mx:SWFLoader id="sampleSWFLoader" source="logo.jpg"
                  open="sampleOpenHandler(event)"
                  progress="sampleProgressHandler(event)"
                  complete="sampleCompleteHandler(event)"/>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Use to load a control stored in swf fileUse <mx:SWFLoader> to load a control stored in swf file
2.Using the SWFLoader control to load a LiveCycle
3.SWFLoader init eventSWFLoader init event
4.Load a SWF by Using the SWFLoaderLoad a SWF by Using the SWFLoader
5.Use SWFLoader to load a swf file