-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.as
35 lines (27 loc) · 1023 Bytes
/
Main.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.display.Loader;
import flash.net.URLRequest;
import mx.core.ByteArrayAsset;
import flash.display.DisplayObject;
import flash.system.ApplicationDomain;
import flash.net.FileReference;
public class Main extends Sprite {
private var _loader:Loader;
public function Main():void {
var urlRequest:URLRequest = new URLRequest('PortalPlayer_177.swf');
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, s_complete);
_loader.load(urlRequest);
}
private function s_complete(e:Event):void {
trace("complete");
var myClass:Class = _loader.contentLoaderInfo.applicationDomain.getDefinition("PlayerLoader_tudouPlayer") as Class;
var byteArray:ByteArrayAsset = new myClass as ByteArrayAsset;
var fr:FileReference = new FileReference();
fr.save(byteArray,"test.swf");
}
}
}