Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
public function Main():void {
var loader:Loader = new Loader();
loader.load(new URLRequest("TestToLoad.swf"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
}
private function onLoaded(e:Event):void {
e.target.removeEventListener(Event.COMPLETE, onLoaded);
var TestClass:Class = e.target.applicationDomain.getDefinition("com.illuzor.test.LoadedClass") as Class;
var loadedClassInstance:Object = new TestClass() as Object;
trace(loadedClassInstance.getTestNumber());
trace(loadedClassInstance.getTestText());
trace(loadedClassInstance.testGetterVar);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment