Nickbee Posted April 21, 2011 Share Posted April 21, 2011 I know this is possible but need some direction on the code... Let's say I make a small loader swf to load a 200K main swf that has a bunch of loadermaxes in it. How do I load things from that loader swf and then add that loaded swf to the stage? Also would I have a loader status for all the content (swf and loadings in the swf). Thanks! Link to comment Share on other sites More sharing options...
GreenSock Posted April 25, 2011 Share Posted April 25, 2011 In your parent (main) swf: var loader:SWFLoader = new SWFLoader("child.swf", {container:this, onProgress:progressHandler, estimatedBytes:50000}); loader.load(); function progressHandler(event:LoaderEvent):void { trace("swf child progress: " + event.target.progress); } Notice the "container:this" - that puts the swf into the display list, assuming "this" refers to a DisplayObjectContainer. Feel free to put whatever reference you want in there. Or you can manually add the content like: addChild(loader.content); And if you want the loaders in the child swf to be factored into the overall progress, make sure they have their requireWithRoot set to that swf's root (or put them into a LoaderMax that has its requireWithRoot set to taht swf's root), like: var queue:LoaderMax = new LoaderMax({requireWithRoot:this.root}); queue.append( new ImageLoader("1.jpg") ); queue.append( new ImageLoader("2.jpg") ); queue.append( new SWFLoader("child2.swf") ); queue.load(); Does that clear things up? 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