mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-27 13:54:49 +00:00
Added: #1383 AS Debugger - debugging nested SWFs
This commit is contained in:
44
libsrc/ffdec_lib/testdata/debug_inner/outer/src/Main.as
vendored
Normal file
44
libsrc/ffdec_lib/testdata/debug_inner/outer/src/Main.as
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
package
|
||||
{
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import flash.display.Loader;
|
||||
import flash.display.LoaderInfo;
|
||||
import flash.utils.ByteArray;
|
||||
|
||||
/**
|
||||
* ...
|
||||
* @author Jindra
|
||||
*/
|
||||
public class Main extends Sprite
|
||||
{
|
||||
[Embed(source="../../inner.swf", mimeType="application/octet-stream")]
|
||||
public var binaryDataClass:Class;
|
||||
|
||||
public function Main()
|
||||
{
|
||||
if (stage) init();
|
||||
else addEventListener(Event.ADDED_TO_STAGE, init);
|
||||
}
|
||||
|
||||
private function init(e:Event = null):void
|
||||
{
|
||||
removeEventListener(Event.ADDED_TO_STAGE, init);
|
||||
|
||||
var byteArray:ByteArray = new binaryDataClass() as ByteArray;
|
||||
var loader:Loader = new Loader();
|
||||
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaderComplete);
|
||||
loader.loadBytes(byteArray);
|
||||
}
|
||||
|
||||
private function onLoaderComplete(event:Event):void {
|
||||
var loaderInfo:LoaderInfo = event.target as LoaderInfo;
|
||||
var className:String = "MyInnerClass";
|
||||
var LoadedClass:Class = loaderInfo.applicationDomain.getDefinition(className) as Class;
|
||||
var instance:* = new LoadedClass();
|
||||
instance.run(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user