问题是这样的,网页首先加载一个swf,然后这个swf再通过URLStream去下载另外一个swf文件,然后对下载到的内容进行解码,再通过loader运行,主体的程序逻辑都是在下载的那个swf文件中。
private var ulrStream:URLStream;
private var coreLoader:Loader;
public function WebRoomDecrypt(){
this.addEventListener(Event.ADDED_TO_STAGE, this.__addStage);
}
private function __addStage(_arg1:Event=null):void{
var _local2:String = stage.loaderInfo.url;
var _local3:String = _local2.substring(0, (_local2.lastIndexOf("/") + 1));
this.ulrStream = new URLStream();
this.ulrStream.load(new URLRequest(((_local3 + "main.swf?"))))));//下载
this.ulrStream.addEventListener(Event.COMPLETE, this.__complete);
this.ulrStream.addEventListener(ProgressEvent.PROGRESS, this.__progress);
}
private function __complete(_arg1:Event):void{
this.ulrStream.removeEventListener(Event.COMPLETE, this.__complete);
this.ulrStream.removeEventListener(ProgressEvent.PROGRESS, this.__progress);
var _local2:ByteArray = new ByteArray();
this.ulrStream.readBytes(_local2);
var _local3:ByteArray = SwfEncrypt.instance.decode(_local2);//解码
this.coreLoader = new Loader();
this.coreLoader.loadBytes(_local3);//加载
this.coreLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.__loaderComplete);
}
然后现在的问题是,我怎么才能把main.swf这个文件保存为完完整整的swf文件呢?刚用swf_reader试了下好像没有保存得了。
谢谢大家了