Loads and unloads the module when you click the button : ModuleLoader « Development « 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 » Development » ModuleLoaderScreenshots 
Loads and unloads the module when you click the button
Loads and unloads the module when you click the button
             
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
  <mx:Script>
    
    import mx.modules.*;
    public function createModule(m:ModuleLoader):void {
      m.url = "a.swf";
      m.loadModule();
    }
    public function removeModule(m:ModuleLoader):void {
      m.unloadModule();
    }
  </mx:Script>
  <mx:Panel title="Module Example" height="90%" width="90%">
    <mx:TabNavigator id="tn" width="100%" height="100%" creationPolicy="auto">
      <mx:VBox id="vb1" label="Column Chart Module">
        <mx:Button label="Load" click="createModule(chartModuleLoader)" />
        <mx:Button label="Unload" click="removeModule(chartModuleLoader)" />
        <mx:ModuleLoader id="chartModuleLoader" />
      </mx:VBox>
      <mx:VBox id="vb2" label="Form Module">
        <mx:Button label="Load" click="createModule(formModuleLoader)" />
        <mx:Button label="Unload" click="removeModule(formModuleLoader)" />
        <mx:ModuleLoader id="formModuleLoader" />
      </mx:VBox>
    </mx:TabNavigator>
  </mx:Panel>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Load and unload a module by using the Button controlsLoad and unload a module by using the Button controls
2.Load module using MXML
3.Unloading a module using ActionScript
4.Use multiple Use multiple <mx:AddChild>
5.Preload modulePreload module
6.Using the ModuleLoader class to load modules
7.Build a unique query string for the module loadingBuild a unique query string for the module loading
8.Report the level of completion during the module's loading processReport the level of completion during the module's loading process
9.Add event listener for loading a Module with ActionScriptAdd event listener for loading a Module with ActionScript
10.Add event listener for module loading progress with ActionScriptAdd event listener for module loading progress with ActionScript
11.Add event listener when module loading is ready with ActionScriptAdd event listener when module loading is ready with ActionScript
12.Add event listener for unloading a module with ActionScriptAdd event listener for unloading a module with ActionScript
13.Module load, progress, ready, setup and unload eventsModule load, progress, ready, setup and unload events
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.