Skip to content

Instantly share code, notes, and snippets.

@illuzor
Created August 6, 2012 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save illuzor/3274457 to your computer and use it in GitHub Desktop.
Save illuzor/3274457 to your computer and use it in GitHub Desktop.
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:ITest = new TestClass() as ITest;
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