Jump to content
GreenSock

Willem

LoaderMax EventHandler on all swf's initialised?

Recommended Posts

Hi Jack,

 

LoaderMax dispatches 'onComplete' when all items are loaded. This doesn't mean that all swf's have been initialized (that _initHandler has been called to set _content when available).

 

Now I add an 'onInit' listener to the last SwfLoader added to the queue, like in:

 

			
queue = new LoaderMax({name:"mainQueue", auditSize:true, onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler});
queue.append(new SWFLoader('assets/swf/Main.swf', {name:"main", autoDispose: false, estimatedBytes:100000, autoPlay: false}));
queue.append(new SWFLoader('assets/swf/Snap.swf', {name:"snap", autoDispose: false, estimatedBytes:100000, autoPlay: false, onInit: lastSwfInitListener}));

 

Is extending LoaderMax with an eventHandler "onAllSwfInit" an option?

 

Thanks!

Link to comment
Share on other sites

Hmm, I'm not convinced this would be a feature that merits the additional file size it would require, and in order to be consistent I'd probably need to add it for other stuff like onAllXMLInitted - see what I mean? You could already implement this sort of thing on your own with some external logic using onInit callbacks that check against the total number that you know you need initialized. I think that would keep LoaderMax cleaner. Agree?

Link to comment
Share on other sites

Okay, small and cleaner code is indeed preferabel.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×