关于提取另外一个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);
}
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);
}