To download the code, you must agree to the following license:

Copyright 2010, GreenSock, Inc.

"NO CHARGE" NON-EXCLUSIVE SOFTWARE LICENSE AGREEMENT
-----------------------------------------------------------------------------
PLAIN ENGLISH SUMMARY:

  1. You may use the code at no charge in commercial or non-commercial web sites, games, components, applications, and other software as long as end users are not charged a fee of any kind to use your product or gain access to any part of it. If your client pays you a one-time fee to create the site/product, that's perfectly fine and qualifies under the "no charge" license. If end users are charged a usage/access/license fee, please sign up for a corporate Club GreenSock membership which comes with a special commercial license granting you permission to do so. See http://www.greensock.com/club/ for details.
  2. Use at your own risk. No warranties are offered.
  3. Please respect the copyright.

-----------------------------------------------------------------------------

LEGALESE:

This is a legal agreement between you (either an individual or a single entity) and GreenSock, Inc. ("GREENSOCK") for the proprietary GreenSock ActionScript code known as TweenLite, TweenMax, TweenNano, TimelineLite, TimelineMax, LoaderMax, and other code that is available for download at http://www.greensock.com (this code and documentation, as well as any updates which may at GREENSOCK's sole discretion be provided to you from time to time, are referred to in this Agreement as "PROGRAM") By downloading, copying, or otherwise using the PROGRAM, you agree to the terms and conditions of this Agreement. If you do not agree to the terms and conditions of this Agreement, please do not download or use the PROGRAM.

I. LICENSE
A. Subject to the terms and conditions of this Agreement, GREENSOCK hereby grants you a non-exclusive, worldwide, non-transferable right to use the PROGRAM in web sites, games, components and other software applications for which the end user is NOT charged any fees. If you would like to use the code in a commercially licensed software product for which end users are charged a fee (either for usage or access), simply sign up for a corporate Club GreenSock membership at http://www.greensock.com/club/.

II. LIMITATION OF LICENSE AND RESTRICTIONS
A. You agree that you will not disclose, sell, rent, or license the PROGRAM's source code or any derivative works thereof to any third party without the prior written consent of GREENSOCK. Derivative works are defined as modifications that add substantive functionality to the PROGRAM and do not include bug fixes or other minor modifications required to operate the PROGRAM as originally intended. Distribution of the source code as part of your Work Product is acceptable so long as the recipients agree to the terms of this Agreement. You agree not to modify or delete GREENSOCK'S existing copyright notice located in the source code.

B. You may use, duplicate, and distribute the compiled object code as embedded in a Work Product created by you, either for your own use or for distribution to a third party so long as end users of the Work Product are not charged a fee for usage of or access to any portion of the Work Product. Please see http://www.greensock.com/licensing/ for descriptions of Work Products that qualify for the "No Charge" license.

III. CONSIDERATION
A. The license rights granted to you under this Agreement are at no charge, but only in the following circumstances: If on your own behalf or on behalf of a third party you incorporate the PROGRAM into a web site, game, software application, program or any component thereof (collectively, "Work Product"), which in the case of a web site, must be accessible to internet users without payment of a fee of any kind, and in the case of a software application, game, program or component, neither you nor anyone to whom you distribute the Work Product charges a user a fee of any kind to use such Work Product or application, game, program or component into which such Work Product is embedded. The foregoing shall apply regardless of whether you are paid to create such Work Product.

B. In the event your intended use of the PROGRAM does not meet the criteria for the "no charge" license rights set forth in the immediately preceding paragraph, then you are not licensed to use the PROGRAM under this Agreement and must license the PROGRAM under GREENSOCK'S separate fee-based Software License Agreement which is granted to corporate Club GreenSock members (see http://www.greensock.com/club/ for details).

IV. TITLE AND OWNERSHIP
A. The PROGRAM is licensed, not sold, and is protected by copyright laws and international treaty provisions. You acknowledge that no title to the intellectual property in the PROGRAM is transferred to you. You further acknowledge that title and full ownership rights to the PROGRAM, including all intellectual property rights therein, will remain the exclusive property of GREENSOCK and you will not acquire any rights to the PROGRAM except as expressly set forth in this Agreement. You agree that any copies of the PROGRAM you make will contain the same proprietary notices which appear on and in the PROGRAM. You agree that GREENSOCK may identify you as a licensee unless you make a written request otherwise. GREENSOCK hereby grants to you the right to disclose that your product, game, software application, component, or other Work Product makes use of GREENSOCK code (for example, "Powered by TweenLite").

V. DISCLAIMER OF WARRANTY AND LIMITATION OF LIABILITY
A. THE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. GREENSOCK DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE PROGRAM WILL MEET YOUR REQUIREMENTS OR THAT OPERATION WILL BE UNINTERRUPTED OR ERROR FREE. GREENSOCK shall not be liable for special, indirect, incidental, or consequential damages with respect to any claim on account of or arising from this Agreement or use of the PROGRAM, even if GREENSOCK has been or is hereafter advised of the possibility of such damages. Because some states do not allow certain exclusions or limitations on implied warranties or of liability for consequential or incidental damages, the above exclusions may not apply to you. In no event, however, will GREENSOCK be liable to you, under any theory of recovery, in an amount in excess of $250. Notwithstanding anything else in this agreement, you agree to indemnify GREENSOCK, its assignees, and licensees, and hold each of them harmless from and against any and all claims, demands, losses, damages, liabilities, costs, and expenses, including legal fees arising out of or resulting from any negligent act or omission by you.

B. GREENSOCK may, at its sole discretion, provide support services related to the PROGRAM, but has no obligation to do so.

VI. TERMINATION
If you at any time fail to abide by the terms of this Agreement, GREENSOCK shall have the right to immediately terminate the license granted herein, require the return or destruction of all copies of the PROGRAM from you and certification in writing as to such return or destruction, and pursue any other legal or equitable remedies available.

VII. MISCELLANEOUS
A. This Agreement shall be construed in accordance with the laws of the State of Illinois. In the event of any dispute between you and GREENSOCK with respect to this Agreement, we both agree that if we cannot resolve the dispute in good faith discussion, either of us may submit the dispute for resolution to arbitration with the American Arbitration Association before a single arbitrator using the AAA Rules for Commercial Arbitration. The arbitrator's decision is final and can be enforced in any court with jurisdiction over such matters.

B. This agreement represents the complete and exclusive statement of the agreement between GREENSOCK and you and supersedes all prior agreements, proposals, representations and other communications, verbal or written, between them with respect to use of the program. This agreement may be modified only with the mutual written approval of authorized representatives of the parties.

C. The terms and conditions of this Agreement shall prevail notwithstanding any different, conflicting, or additional terms or conditions which may appear in any purchase order or other document submitted by you. You agree that such additional or inconsistent terms are deemed rejected by GREENSOCK.

D. GREENSOCK and you agree that any xerographically or electronically reproduced copy of this Agreement shall have the same legal force and effect as any copy bearing original signatures of the parties.

I'd like to learn how to get bonus plugins, update notifications, SVN access, and more.
To continue, you must agree to the following license:

LoaderMax – Smart AS3 Loading

  • Version: 1.4, Updated 2010-09-01
  • Compatibility: AS3 (Flash Player 9 or later)

LoaderMax is a new AS3 loading system that does much more than just get swf, mp3, css, video, image, text, binary, and xml files into your Flash application. It eats files for dinner, burps, and then asks for 2nds. And 3rds. Yet it's surprisingly thin. In fact, it can be half the size of most other loading systems even though it delivers a bunch of unique capabilities, some of which you probably never knew you needed but won't want to live without. Here are a few of the noteworthy features:

  • Integration of loaders inside subloaded swfs - with most other systems, if you subload a swf, the loader will only concern itself with the swf file's bytes but what if that swf must subload other content like XML, images, and/or other swf files before it should be considered fully loaded? LoaderMax can elegantly handle the sub-subloads as deep as they go. You can link any loader and/or LoaderMax with a swf's root (using the requireWithRoot vars property) so that when you subload it into another Flash application, the parent SWFLoader automatically factors the nested loaders into its overall loading progress! It won't dispatch its COMPLETE event until they have finished as well.
  • Automatic parsing of LoaderMax-related nodes inside XML - The XMLLoader class automatically looks for LoaderMax-related nodes like <LoaderMax>, <ImageLoader>, <SWFLoader>, <XMLLoader>, <VideoLoader>, <DataLoader>, <CSSLoader>, <MP3Loader>, etc. in XML files that it loads, and if any are found it will create the necessary instances and then begin loading the ones that had a load="true" attribute, automatically integrating their progress into the XMLLoader's overall progress and it won't dispatch a COMPLETE event until the XML-driven loaders have finished as well. See XMLLoader's ASDocs for details.
  • Tight file size - Many other systems are 16-24k+ even if you're just loading text, but LoaderMax can be as little as 7k (depending on which loader types you use).
  • Define an alternateURL for any loader - If the original url fails to load, it will automatically switch to the alternateURL and try again.
  • A common set of properties and methods among all loaders - All loader types (XMLLoader, SWFLoader, ImageLoader, MP3Loader, CSSLoader, VideoLoader, LoaderMax, etc.) share common properties like: content, name, status, loadTime, paused, bytesLoaded, bytesTotal, and progress as well as methods like: load(), pause(), resume(), prioritize(), unload(), cancel(), auditSize() and dispose() delivering a touch of polymorphism sweetness.
  • Nest LoaderMax instances inside other LoaderMax instances as deeply as you want. - A LoaderMax instance is basically a queue of loaders which makes it simple to control them as a whole and get the overall progress, bytesLoaded, and/or bytesTotal. You can put a queue into another - group and nest them however you want. This makes complex queues simple. Need to know when the first 3 loaders have finished loading inside a 10-loader queue? Just put those 3 into their own LoaderMax that has an onComplete and nest that LoaderMax inside your main LoaderMax queue.
  • Set a width/height for an ImageLoader, SWFLoader, or VideoLoader and when it loads, the image/swf/video will automatically scale to fit using any of the following scaleModes: "stretch", "proportionalInside", "proportionalOutside", "widthOnly", or "heightOnly". Even crop the image inside that area with crop:true
  • Conveniences like auto smoothing of images, centering their registration point, noCache, setting initial x, y, scaleX, scaleY, rotation, alpha, and blendMode properties, optional autoPlay for mp3s, swfs, and videos, and more.
  • Works around common Flash hassles/bugs - LoaderMax implements workarounds for things like garbage collection headaches with subloaded swfs, images, and NetStreams as well as other problems like the recently discovered issues with subloading swfs that use TLF.
  • Find loaders and content by name or url - Every loader has a name property which you can use to uniquely identify it. Feed a name or URL to the static LoaderMax.getLoader() or LoaderMax.getContent() methods to quickly get the associated loader or content.
  • A single loader can belong to multiple LoaderMax instances
  • Accurate progress reporting - For maximum performance, set an estimatedBytes for each loader or allow LoaderMax's auditSize feature to automatically preload just enough of each child loader's content to determine its bytesTotal, making progress reporting on large queues very accurate.
  • prioritize() a loader anytime - Kick an object to the top of all LoaderMax queues to which it belongs, immediately supplanting the top spot in each one.
  • A robust event system - events bubble up through LoaderMax hierarchies and carry a consistent target for easy identification
  • Media playback controls in VideoLoader and MP3Loader - convenient methods like playVideo(), pauseVideo(), and gotoVideoTime() as well as properties like playProgress, videoTime, videoPaused, volume, and duration plus useful event dispatching like VIDEO_COMPLETE, PLAY_PROGRESS, and lots more make it simple to wire your own interface to VideoLoader and use it for full playback control, not just loading. Similar controls are available for MP3Loader too.
  • Set up multiple event listeners in one line - Add listeners like onComplete, onProgress, onError, etc. via the constructor like new LoaderMax({name:"mainQueue", onComplete:completeHandler, onProgress:progressHandler, onError:errorHandler});
  • maxConnections - Set the maximum number of simultaneous connections for each LoaderMax instance (default is 2). This can speed up overall loading times.
  • pause()/resume() - no queue loading solution would be complete without the ability to pause()/resume() anytime.
  • Helper classes for code hinting and strict data typing - Check out the com.greensock.loading.data package for classes like LoaderMaxVars, ImageLoaderVars, XMLLoaderVars, etc.
  • Flex friendly - Simply change the LoaderMax.contentDisplayClass to FlexContentDisplay and then ImageLoaders, SWFLoaders, and VideoLoaders will return content wrapped in a UIComponent.

Rich Shupe debuted LoaderMax in his presentation at Flashbelt (thanks Rich!). You can view his slides here.

Interactive demo 1

Documentation

Please view full ASDoc documentation here.

Sample AS3 code

Actionscript:
  1. import com.greensock.*;
  2. import com.greensock.loading.*;
  3. import com.greensock.events.LoaderEvent;
  4. import com.greensock.loading.display.*;
  5.  
  6. //create a LoaderMax named "mainQueue" and set up onProgress, onComplete and onError listeners
  7. var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler});
  8.  
  9. //append several loaders
  10. queue.append( new XMLLoader("xml/data.xml", {name:"xmlDoc"}) );
  11. queue.append( new ImageLoader("img/photo1.jpg", {name:"photo1", estimatedBytes:2400, container:this, alpha:0, width:250, height:150, scaleMode:"proportionalInside"}) );
  12. queue.append( new SWFLoader("swf/main.swf", {name:"mainClip", estimatedBytes:3000, container:this, x:250, autoPlay:false}) );
  13.  
  14. //add a loader to the top of the queue using prepend()
  15. queue.prepend( new MP3Loader("mp3/audio.mp3", {name:"audio", repeat:2, autoPlay:true}) );
  16.  
  17. //prioritize the loader named "photo1"
  18. LoaderMax.prioritize("photo1")//same as LoaderMax.getLoader("photo1").prioritize();
  19.  
  20. //start loading
  21. queue.load();
  22.  
  23. //pause loading
  24. queue.pause();
  25.  
  26. //resume loading
  27. queue.resume();
  28.  
  29. function progressHandler(event:LoaderEvent):void {
  30.     trace("progress: " + event.target.progress);
  31. }
  32.  
  33. function completeHandler(event:LoaderEvent):void {
  34.     var image:ContentDisplay = LoaderMax.getContent("photo1");
  35.     TweenLite.to(image, 1, {alpha:1, y:100});
  36.     trace(event.target + " is complete!");
  37. }
  38.  
  39. function errorHandler(event:LoaderEvent):void {
  40.     trace("error occured with " + event.target + ": " + event.text);
  41. }

Interactive demo 2

FAQ

  1. Where do I get the code?
    LoaderMax is included in the main AS3 GreenSock download zip - just click the "Download AS3" button at the top right corner of this page.
  2. What if I need to send variables to the server along with my request in a loader?
    The first parameter of the various loaders (ImageLoader, XMLLoader, SWFLoader, MP3Loader, etc.) accepts either a simple String URL or a URLRequest. So if you want to pass data to the server, simply construct a URLRequest accordingly, like:

    Actionscript:
    1. var request:URLRequest = new URLRequest("http://www.yourDomain.com/whatever.php");
    2. var variables:URLVariables = new URLVariables();
    3. variables.exampleSessionId = new Date().getTime();
    4. variables.exampleUserLabel = "label1";
    5. request.data = variables;
    6. request.method = URLRequestMethod.POST;
    7. var loader:ImageLoader = new ImageLoader(request, {name:"image1"});

  3. Do I need to define estimatedBytes for all my loaders?
    Nope. If you don't define one, the default value of 20000 will be used. The only benefit of defining an estimatedBytes is to make the loader's progress more accurate before it has downloaded enough information to determine the bytesTotal. Once it can accurately determine the bytesTotal, it will do so and stop using the estimatedBytes. By default, when a LoaderMax loads, it will loop through its children first and find any that don't explicitly define an "estimatedBytes" and quickly open a URLStream to determine the bytesTotal if possible. There's a slight speed penalty when the LoaderMax first starts loading, but it makes it very accurate. You can turn that feature off with auditSize:false in your LoaderMax's vars parameter.
  4. If a child loader inside a LoaderMax has already completed and I call load() again on the LoaderMax, will it waste time reloading that already-completed loader?
    No. If a loader has completed, LoaderMax will skip it in the queue for maximum efficiency and performance. If you want to force a full reload, though, set the "flush" parameter to true in your load() call, like myLoader.load(true)
  5. Why do I have to use different loader types (ImageLoader, XMLLoader, SWFLoader) instead of LoaderMax automatically figuring out the type of loader needed based on the file name extension?
    Actually, LoaderMax has a parse() method that can do exactly that (automatically figure out the type of loader necessary based on the file extension) - you just need to make sure you use LoaderMax.activate() first to activate the loader types that you want LoaderMax to be able to recognize (like ImageLoader, SWFLoader, etc.). This extra step may seem annoying, but there are a few reasons I opted to avoid building the system in a way that activates all of the loader types by default:

    • It forces ALL types of loaders to be compiled in your swf so that they're available just in case you need them. So your project may never need an SWF loader or MP3 loader, etc. but they still must be compiled in your SWF for the logic in the "lazy" loader. In my opinion, this bloats the whole system which isn't good because a loading system should be relatively lightweight in order to get things moving quickly.
    • It's virtually impossible to accurately determine the file type if the extension is something like ".php" because you could have a server-side script that spits back any type - an image, an XML file, etc. In those cases, the "lazy" system would break down. You'd have to explicitly define the type anyway.

    Ultimately I believe it is much cleaner to have the developer choose the appropriate loader for the asset whenever possible (ImageLoader, SWFLoader, XMLLoader, etc.) and it definitely allows the system to be more lightweight and efficient. It could literally reduce the file size requirement by more than 60% in many cases.

  6. Is the LoaderMax API finalized? Might it change?
    This is a 1.0 release and while there are no plans to make any changes to the API, my experience has been that feedback from the community is invaluable and can help shape the API. I try to keep improving things to serve end users better, so don't be surprised if there are some changes in upcoming months. I would recommend checking back frequently for updates or sign up for Club GreenSock so that you can be notified.
  7. Can I make suggestions for improving LoaderMax?
    Please do! Either in the comments section below or in the forums.
  8. Why did you use the loosely typed vars parameter to define all the special properties (like {name:"myLoader", width:100, height:200}) instead of regular strong-typed parameters or properties? Your way doesn't give me code hinting either.
    True. However, one of the objectives was to keep file size to a minimum and encourage readable code, neither of which could be accomplished very well otherwise. There are quite a few optional special properties for various loaders (SWFLoader recognizes 41!) and regular parameters just wouldn't be feasible. Which one is more readable?:

    Actionscript:
    1. new SWFLoader("main.swf", "myFile", 100, 100, 200, 200, this, completeHandler, null, null, progressHandler);
    2. -OR-
    3. new SWFLoader("main.swf", {name:"myFile", x:100, y:100, width:200, height:200, container:this, onComplete:completeHandler, onProgress:progressHandler});

    But don't worry - if you want strong typing and code hinting, there are some helper classes for exactly that - Check out the com.greensock.loading.data package for classes like LoaderMaxVars, ImageLoaderVars, XMLLoaderVars, etc. that allow you to define all your vars stuff with a special object.

  9. Can I get the source code for the demos above?
    Sure, download it here.
  10. Is LoaderMax available in AS2? Will it be?
    The tweening platform and TransformManager, my 2 most popular products, ARE available in AS2 as well as AS3 but LoaderMax is only AS3 because...well...AS2 has been on the decline for a long time and LoaderMax relies heavily on the event system in AS3 so it would be a much bigger challenge to port it to AS2. Then there's maintenance. Right now, every time I make an update to the AS3 version of TweenLite/Max/TimelineLite/Max/TransformManager, I must also make the update to the AS2 versions, copy all the files, create zips, post to the SVN, update the bonus zips for members, etc., Then there are language-specific differences I'd need to accommodate. So it just doesn't seem worthwhile to do for a product like LoaderMax especially since AS2 is heading towards extinction.
  11. Will you be posting more examples?
    Yes.
  12. Do I have to purchase a license to use this code? Can I use it in commercial projects?
    You may use the code at no charge in commercial or non-commercial web sites, games, components, applications, and other software as long as end users are not charged a fee of any kind to use your product or gain access to it. If your client pays you a one-time fee to create the site/product, that's perfectly fine and qualifies under the "no charge" license. If multiple end users are charged a usage/access/license fee of any kind, please simply sign up for a corporate Club GreenSock membership which comes with a special commercial license granting you permission to do so. Click here for details. Club GreenSock members get several useful bonus plugins, classes, update notifications, SVN access, and more. Please see the licensing page for details on licensing.

Need help?

Please post your question in the forums. You'll increase your chances of getting a prompt answer if you provide a brief explanation and include a simplified FLA file (and any class files) that clearly demonstrates the problem.

Author: Jack Doyle
Copyright 2010, GreenSock (This work is subject to the terms here.)

Comments (70) RSS

Posted by Elliot James Chong on June 16, 2010

I’m very excited to try the new library out Jack, loving the features you’ve included! Thank you for sharing!

Posted by Mark on June 16, 2010

GreenSock have done it again. My life just got a whole lot easier. Thank you!

Posted by Josh on June 16, 2010

Amazing work. Again. Thank you so much!

Posted by Steven on June 16, 2010

Ah, if only you released this 5 days ago! ;) Very nice work, I can’t wait to use it in my next project.

Posted by Dennis on June 16, 2010

Watching Rich demo it now. Thanks, Jack.

Posted by Ahrengot on June 16, 2010

I was one of the beta testers on this system, and have had some time to play aound with it on various projects. I truly recommend anyone dealing with web design/development to give it a go. It wil save you a huge load of time and trouble! (Sorry, couldn’t help the pun).

Posted by Ramiro Araujo on June 16, 2010

Congratulations! I’m already using it for production while it was beta :D , working like charm!

Posted by Mads Bjerre on June 16, 2010

You deserve a medal, Jack!

Posted by Elliot Geno on June 16, 2010

Wow that was close… I started down the road of creating my own, but I think I will use yours instead!

Posted by Teksetta on June 16, 2010

This is such a great utility and was built smartly. I’ve already started playing with it on multiple levels. Thank you so much!!

Posted by Marcelo Duende on June 16, 2010

Insane feature, it is a kind of bulkLoader, but very better. INSANE

Posted by Jay Wood on June 16, 2010

Great stuff (again). They should give out extremely shiny gold stars for this sort of thing. As ever, thanks for sharing all your hard work…

Posted by Urda on June 16, 2010

Again ? Jacks seal of quality: Small size and nestable. First TweenLite and now this ? Im a good Coder, but now i have inferiority complexes.
I hate you!

Posted by theHuston on June 16, 2010

Amazing. Many thanks.

Posted by theRemix on June 16, 2010

Awesome! Great work as usual guys!

Posted by Noah on June 16, 2010

Jack you are the man. This is so well done and sorely needed.

Posted by Nate Beck on June 16, 2010

Amazing job! Thanks for all of your hard work!

Posted by Fredrik on June 16, 2010

Fantastic work as always Mr. Green :o )

Posted by Arnie on June 16, 2010

Wow. Make that Wow!

Great, man.

Posted by sjimmisja on June 16, 2010

Frikkin awesome!! No more loading pains!!

Posted by Iván Gajate on June 16, 2010

Awesome!, I’m gonna play with it right now! ;

Posted by Paespedro on June 16, 2010

Very nice, I’ll take a look at it. Maybe this will be a good competitor for the also amazing Arthur Debert’s Bulk Loader (http://code.google.com/p/bulk-loader/).

Posted by teeeoooemmm on June 16, 2010

Saving dev lives left right and centre Jack Doyle – whoever you are! Thanks again!

Posted by Rod on June 16, 2010

Been using QueueLoader for most of my previous projects, really looking forward to playing with this though – centering the registration point and setting required w & h before its loaded, hell yeah!

Posted by Rod on June 16, 2010

There probably isn’t, but I’ll still ask – Is there any performance penalties in XMLLoader while it checks for LoaderMax specific tag names? And if so, can we disable this?

Posted by Rod on June 16, 2010

Silly me – integrateProgress = false to disable XMLLoader looking for LoaderMax related nodes :)

Posted by David C on June 16, 2010

Haven’t had a chance to work with LoaderMax yet, but just cos it’s from GreenSock I know I’m gonna love it!

Posted by Paespedro on June 16, 2010

Well, after a little look at the LoaderMax i can say that it IS better than the BulkLoader in a lot of ways. It’s like a future version of it for me, plus lots of extras like you always do.

Posted by Mario on June 16, 2010

This is going to be a huge hit! You’re doing so much good to the community, Jack. You the man! Adobe should thank you personally and offer a partnership or something!

Posted by lordB8r on June 16, 2010

I love that it can eat seconds, then thirds, and still stay slim! Loving it. Thanks for the lib – looking forward to using it as much as possible.

Posted by Justin Bernard on June 16, 2010

rocking again, jack!

Posted by turtlebite on June 16, 2010

This is awesome! I will definitly integrate it in the next release of the Fleb Framework (www.flebframework.com)!

Posted by Tim on June 16, 2010

Best work, as usual!
Thanks Jack! I already used it while it was beta.

Keep up the great work and make our life easier!

Posted by Ocho Durando on June 16, 2010

Fantastic Library!
Great job Jack!

Posted by Dourado on June 17, 2010

Many projects especially those like micro/publicity web apps require all time loads so loads are in some cases my first concern. That’s why I have been working with bulkLoader for a while and I use a class that manage all the load’s that my app requires thru bulkloader and XML.

Now you create this…wow.. it’s like “listening” my methods!? :)
Great job Jack!

Posted by Sébastien on June 17, 2010

Nice class ! Very usefull. I will use it in my next projects, for sure. Thanks for sharing ;)

Posted by activetofocus on June 17, 2010

Great tools.I like it.

Posted by Christian on June 17, 2010

How can I cast a loaded SWF to a custom datatype (like a baseclass or Interface)

Get rumtime errors when I try…

Posted by Christian on June 17, 2010

Got it! This is how:

var myLoadedSWF : MyCustomDataType;

myLoadedSWF = SWFLoader.rawContent as MyCustomDataType;
addChild(_module as DisplayObject);

Posted by Adam Jackett on June 17, 2010

I wrote my own class a couple weeks ago – MultiLoader… what a waste of time because this kicks my loader’s @$$. I’m proud to be a shockingly green member. Thanks for making my life so much easier.

Posted by Joshua Ben on June 17, 2010

Once again you guys have rocked it. This is exciting, and I am going to start a new project just as a study in LoaderMax.
Thanks

Posted by grabek on June 17, 2010

About Freakn’ time dude!!! I remember a time about a year ago when I asked if you were going to create this. And now you have!

Super awesome job! Best script ever ;)

Posted by Randall W. Haws on June 17, 2010

Brilliant. Magic.

Posted by Brandon on June 18, 2010

I’ve been wishing and hoping GreenSock would do this for years! I’m so absolutely excited and happy, it raises suspicion.

Awesome! Thank you!

-B

Posted by tamt on June 22, 2010

thanks for sharing~~

Posted by Adam on June 22, 2010

Awesome! This looks like an awesome preloading class… I can wait to try it out. Thanks for sharing!

Posted by Peter_D on June 24, 2010

Fantastic work…as always ;)

Posted by mdac on June 26, 2010

Well… If I needed a kick up the backside to finally switch to as3, then this is it.

Ok jack you’ve finally convinced me.

Fine work.

Posted by jrams623 on June 27, 2010

Thanks for this amazing utility! I’ve been able to overhaul my entire workflow.

Posted by Tim on June 30, 2010

This is so awesome, thanks for your efforts!

Feature request: DownloaderMax – Ability to queue up files like this for physical download to local machine with directory structure. Would be absolutely perfect for offline AIR apps that depend on externally loaded content.

Posted by Sébastien on July 2, 2010

Very nice loader solution ;) Thanks a lot for sharing this !

Posted by leef on July 3, 2010

This is great! I’ve built several loaders overtime, usually in response to a project’s need, and each time have improved on reusability, and features, but haven’t taken it this far. Thanks!!!

Posted by Joisiney Leandro on July 9, 2010

Is it possible to pass a parameter to the onComplete handler. Kinda like:

_swfLoader = new SWFLoader(“child.swf”, {parameters:["josé", "joão"], onComplete:_completeHandler});

function _completeHandler(event:LoaderEvent):void {
trace(event.target.parameters);
}

Posted by Kaleb Wyman on July 9, 2010

This is brilliant. Kudos, Jack.

Posted by Jack on July 9, 2010

Sure, you can use the vars object to store your data, like this:

_swfLoader = new SWFLoader(“child.swf”, {parameters:["josé", "joão"], onComplete:_completeHandler});

function _completeHandler(event:LoaderEvent):void {
trace(event.target.vars.parameters);
}

Posted by Fernando Checa on July 12, 2010

Hi,

Could you access events in loaderMax?

I would like to know when an element has loaded but not with an onComplete function.

I would like to add an event listener to do that.
Listen to events and take actions based on that.

Thanks

Posted by Jack on July 12, 2010

Absolutely, Farnando – LoaderMax is fully compatible with the standard addEventListener() way of working in AS3. The various special properties like onComplete, onProgress, onFail, etc. are simply shortcuts that allow you do set up all those listeners in one fell swoop. It shortens the amount of code you need to write, but feel free to do stuff like this if you prefer:

loader.addEventListener(LoaderEvent.COMPLETE, completeHandler);

Posted by swfninja on July 13, 2010

Jack, you never cease to amaze!

Posted by Fernando Checa on July 15, 2010

How are files loaded?
If I add 3 images to the queue, do they start to load all at the same time?
I ask because I would like to be able to load sequentially. One file at a time. Is that possible?
Or do I have to load one file, wait until it’s finished loading and then add the next one to the loader?

Posted by Jack on July 15, 2010

LoaderMax gives you complete control over how your queue loads. There’s a maxConnections property that controls how many files it will try to load simultaneously (the default value is 2 which provides a nice mix of prioritization and speed). If you set maxConnections to 1, it will load one file at a time, but loading things sequentially like that is slightly slower because it doesn’t allow Flash to leverage multiple streams at the same time. In other words, if maxConnections is 2 instead of 1, it will finish the overall load of the entire queue a bit faster because it can make better use of your connection.

If you want things to load sequentially one-after-the-other, just set maxConnections to 1, dump all your loaders into the LoaderMax, and let ‘er rip. LoaderMax will handle everything for you.

Posted by Mike Donnelly on July 28, 2010

Jack, thank you so much! You get the high score for karma points, helping out so many embattled coders with such *total* quality software!! What on earth will you do next?

Posted by mlemonro on July 28, 2010

There is some changelog for this module? New version came out, so it would be nice to see what’s new or whats changed in this release without using diff on the source code..

Posted by Jack on July 28, 2010

mlemonro, yep, there’s a changelog.txt file in the com/greensock/loading directory.

Posted by Zync on August 1, 2010

Loving loaderMax, works soo well and no hiccups. Would love to see an appendURLs method added. That way our array of files could be just the filename without the extension repeating (eg. .jpg). Guess it would only be useful for gallery’s but every bit of text saving counts :D

var aImages:Array = new Array(“image1″,”image2″); //etc

instead of

var aImages:Array = new Array(“image1.jpg”,”image2.jpg”); //etc

Posted by iguoguo on August 14, 2010

very good framework.
I must spend much time to learn it.
Thank you .

Posted by Bruno on August 14, 2010

You are the man! Thanks a lot again!!!

Posted by Paras Sheth on August 17, 2010

well green this is!

Posted by Zach Zurn on August 17, 2010

Thank you so much for all of your classes. They are extremely well written and easy to use.

I can’t find one project where I won’t use your classes all over the place.

Posted by Benjiman on August 19, 2010

Excellent,good job ……I am enjoying your loader~~

Posted by Cameron Kingzett on August 19, 2010

Ridiculously good. Jack takes everything up a level with his tools, and yet somehow makes it simpler as well.

The control and depth of event management for loading is great, the documentation is excellent, the file size trumps all others, and now I get to have my loader, and my tweener living happily under one roof.

Leave your other bloat-loaders behind!