Share Posted December 2, 2014 I'm trying to get hold of flash.display.Loader used by the SWFLoader in order to manually instantiate/setup the custom document class used by the SWF. typically in as3, we'd use flash.display.Loader as below. var className:String = getQualifiedClassName(loader.content); var classRef:Class = loader.contentLoaderInfo.applicationDomain.getDefinition(className) as Class; var captureModule = new classRef(); addChild(captureModule as DisplayObject); LoaderMax routine loaderMax.append(new SWFLoader("capture.swf", {name:"capture"})); completeHandler, stuck at trying to get the loader object, seems it's private. Any suggestions please? function completeHandler(event:LoaderEvent): void { var className:String = getQualifiedClassName(loaderMax.getContent("capture").rawContent); var loader = loaderMax.getLoader("capture"); //It's SWFLoader //var classRef:Class = loader.contentLoaderInfo.applicationDomain.getDefinition(className) as Class; //trace(classRef); } Link to comment Share on other sites More sharing options...
Author Share Posted December 2, 2014 Got it... var className:String = getQualifiedClassName(loaderMax.getContent("capture").rawContent); var loader = loaderMax.getContent("capture").rawContent.loaderInfo.loader; var classRef:Class = loader.contentLoaderInfo.applicationDomain.getDefinition(className) as Class; trace(classRef); Link to comment Share on other sites More sharing options...
Share Posted December 3, 2014 Cool, thanks for posting your solution. Just so you know, SWFLoader has a getClass() which might help too. http://greensock.com/asdocs/com/greensock/loading/SWFLoader.html#getClass() Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now