Hello,
I am using the Loader class to load 3 external swfs:
- sharedTopics.swf (does not have a document class)
- fonts.swf (document class is FontManager)
- main.swf (document class is Main)
The same loader is used to load all 3 assets.
__assetLoader = new Loader();
var urlReq:URLRequest = new URLRequest(target.path);
__assetLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, this.preloadProgress);
__assetLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.assetCompleteHandler);
__assetLoader.contentLoaderInfo.addEventListener(Event.INIT, this.assetInitHandler);
__assetLoader.load(urlReq);
In the complete handler, I add the loader content to a movie clip then trace out a variable:
var swf:DisplayObject = __assetLoader.content;
Debug.doTrace("Shell:: assetCompleteHandler():: content " + swf);
__app.addChild(MovieClip(swf));
When the sharedTopics, fonts and main swfs (respectively) are loaded I get the following trace statements:
Shell:: assetInitHandler():: evt.currentTarget.content [object MovieClip]
Shell:: assetInitHandler():: evt.currentTarget.content [object FontManager]
Shell:: assetInitHandler():: evt.currentTarget.content [object Main__Preloader__]
I would expect that the last trace statement would look similar to '[object Main]' which would be the name of the document class however, instead the content is the loader. Any ideas as to why this is happening?
In a later function I try to call the init function of the Main class and get the following error:
Error #1069: Property init not found on classes.Main__Preloader__ and there is no default value.
I hope this is explained clearly.
Thanks in advance,
Mike