关于提取另外一个swf里的某个mc问题

public function role(){
   loader=new Loader();   
   bodyrequest=new URLRequest(bodyFILE_PATH);
   loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete);   
   loader.load(bodyrequest);
  }
  
  private function onComplete(event:Event):void{
   var loaderSWF=event.target;
   var domain:ApplicationDomain=loaderSWF.applicationDomain as ApplicationDomain
;
   //从加载的swf域中提取类定义   
   var bodyClass:Class=domain.getDefinition("walk") as Class;
   var body:MovieClip=(new bodyClass()) as MovieClip;
   body.x=500,body.y=400;
   addChild(body);
  }

posted on 2009-03-29 18:01  jiahuafu  阅读(235)  评论(0编辑  收藏  举报

导航