Development Flex



  
    
      import mx.events.FlexEvent;
      import mx.events.ModuleEvent;
      import mx.modules.ModuleManager;
      
      private var flag:Boolean = true;
      private var dynamicModule:ModuleLoader;
      
      private function changeMac():void 
      {
            dynamicModule = new ModuleLoader();
            dynamicModule.url = "a.swf";
            dynamicModule.addEventListener( FlexEvent.LOADING, eventHandler );            
            this.addChild( dynamicModule );
  
            dynamicModule.loadModule();
            dynamicModule.unloadModule();
      }
      
      private function eventHandler( event:Event ):void
      {
        trace( "Control: " + event.currentTarget + " type: " + event.type );
      }
  
  

  
                      url="a.swf"
                    loading="eventHandler( event )"
                    progress="eventHandler( event )"
                    ready="eventHandler( event )"
                    setup="eventHandler( event )"
                    unload="eventHandler( event )" />
                      url="a.swf"
                    loading="eventHandler( event )"
                    progress="eventHandler( event )"
                    ready="eventHandler( event )"
                    setup="eventHandler( event )"
                    unload="eventHandler( event )" />