Thanks Claudiu,
 
I put the code into flex3, it works well. I think it's the problem.



在2009-06-29,"claudiu ursica" <the_bran...@yahoo.com> 写道:





I dunno haven't switched to F4 yet, at least haven't developed any commercial 
stuff only played with it a little bit and haven;t touched the modules yet in 
F4.

check help file this http://livedocs.adobe.com/flex/gumbo/html/flex_4_help.pdf  
maybe they have something in there ... 

C



From: j2me_soul <j2me_s...@163.com>
To: flexcoders <flexcoders@yahoogroups.com>
Sent: Monday, June 29, 2009 2:55:26 PM
Subject: Re:Re: Re: [flexcoders] How to use modulemanger to load modules



I can sure. Because if getModule return a unvalid value the next sentence will 
be going wrong.
I use the Flex4 SDK. Is that make thing complexed?
 
  protected function application_ initializeHandle r():void
  {
   module = ModuleManager. getModule( "modules/ workalert_ mod.swf") ;
   module.addEventList ener(ModuleEvent .READY, moduleReadyHandler) ;
   module.load( );
  }
/* it doesn't run actually*/
  private function moduleReadyHandler(e:ModuleEvent) :void{
   switch(module. url){
    case "module/workalert_ mod.swf":
     AllStaffLoader. removeAllChildre n();
     AllStaffLoader. addChild( module.factory. create() as DisplayObject) ;
     break;
   } 
  }
 
<mx:ModuleLoader 
   id="AllStaffLoader" width="100%" height="292"
   x="0" y="475"  x.workAlert= "1" y.workAlert= "478"/


在2009-06-29,"claudiu ursica" <the_braniak@ yahoo.com> 写道:





Your code looks fine to me... Are you sure the getModule() returns a valid 
instance??

C




From: j2me_soul <j2me_s...@163. com>
To: flexcoders <flexcod...@yahoogro ups.com>
Sent: Monday, June 29, 2009 2:28:25 PM
Subject: Re:Re: [flexcoders] How to use modulemanger to load modules



If I declare a moduleloader object in mxml it works.
<mx:ModuleLoader url="modules/ workalert_ mod.swf"
      id="AllStaffLoader" width="100%" height="292" 
      x="0" y="475"  x.workAlert= "1" y.workAlert= "478"/>
But I want to dynamically load a module, so I try to do this using 
modulemanager.
 
private var WorkAlert:Class;
protected function application_ initializeHandle r():void
  {
   module = ModuleManager. getModule( "modules/ workalert_ mod.swf") ;
/* the event never dispatch, Why ? */
/* I can't do angthing, because there is no error at runtime at all */
   module.addEventList ener(ModuleEvent .READY, moduleReadyHandler) ;
   module.load( ); 
  }
 
 

 

在2009-06-29,"claudiu ursica" <the_braniak@ yahoo.com> 写道:





There is this document issued by adobe where they explain with examples how to 
handles modules ...
http://blogs. adobe.com/ flexdoc/pdfs/ modular.pdf

TH,
C



From: j2me_soul <j2me_s...@163. com>
To: flexcoders <flexcod...@yahoogro ups.com>
Sent: Monday, June 29, 2009 1:53:37 PM
Subject: [flexcoders] How to use modulemanger to load modules



How to load a module ?





200万种商品,最低价格,疯狂诱惑你





200万种商品,最低价格,疯狂诱惑你





200万种商品,最低价格,疯狂诱惑你


Reply via email to