Share Posted October 26, 2012 Hi, I am using loadMax with loaderImage now i coming into a performance problem not on desktop but on tablet i have about 60+ images to load all at once, is there a way you can delay the loader like if it hit 20 items and delay 2 secs and keep load... cheers bill Link to comment Share on other sites More sharing options...
Share Posted October 26, 2012 Hi and Welcome to the GreenSock forums, You could do this a few ways. Easiest: give loader#20 and loader#40 a unique onComplete callback that pauses the LoaderMax they are part of. function onCompleteSpecial(e:LoaderEvent):void{ myLoaderMax.pause(); TweenLite.delayedCall(2, myLoaderMax.resume); } Or each ImageLoader could call the same onComplete function that checks to see how many loaders are loaded. If that number is a multiple of 20 then pause the LoaderMax something like function onCompleteHandler(e:LoaderEvent):void{ var completeLoaders:int = myLoaderMax.getChildrenByStatus(LoaderStatus.COMPLETED).length if(completeLoaders == 20 || completeLoaders == 40){ myLoaderMax.pause(); TweenLite.delayedCall(2, myLoaderMax.resume); } } if you have a lot more loaders, you would want to make that conditional statement more flexible. --- You could also create 3 LoaderMax's that each contain 20 images, and then when each LoaderMax completes wait 2 seconds to start the next one. There are probably a half-dozen more ways to approach this. Just giving some ideas. The API is very robust and at any point in time you have access to a ton of info about what each loader is doing. You can read more about the getChildrenByStatus method here: http://www.greensock.com/as/docs/tween/com/greensock/loading/LoaderMax.html#getChildrenByStatus() let us know if you need more help. -c Link to comment Share on other sites More sharing options...
Author Share Posted October 27, 2012 Thanks very much Carl. That's the perfect answer that i am seeking for. 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