Report level of completion during the module's loading process : ModuleManager « 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 » ModuleManagerScreenshots 
Report level of completion during the module's loading process
Report level of completion during the module's loading process
          
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
  <mx:Script>
    
    import mx.events.ModuleEvent;
    import flash.events.ProgressEvent;
    import mx.modules.*;
    [Bindable]
    public var progBar:String = "";
    [Bindable]
    public var progMessage:String = "";
    private function progressEventHandler(e:ProgressEvent):void {
      progBar += ".";
      progMessage =Math.round((e.bytesLoaded/e.bytesTotal100"%";
    }
    public function createModule():void {
      chartModuleLoader.loadModule();
    }
  </mx:Script>
  <mx:Panel title="Module Example" height="90%" width="90%">
    <mx:HBox>
      <mx:Label id="l2" text="{progMessage}" />
      <mx:Label id="l1" text="{progBar}" />
    </mx:HBox>
    <mx:Button label="Load" click="createModule()" />
    <mx:ModuleLoader id="chartModuleLoader" url="a.swf" progress="progressEventHandler(event)" />
  </mx:Panel>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Use ModuleManager to manage swf fileUse ModuleManager to manage swf file
w__w_w.__jav_a2s_.___com__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.