HomeAbout

LoaderMax – Smart AS3 Loading

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:

http://www.LoaderMax.com

  • 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”.
  • 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
  • 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.
  • Flex friendly – Simply change the LoaderMax.contentDisplayClass to FlexContentDisplay and then ImageLoaders, SWFLoaders, and VideoLoaders will return content wrapped in a UIComponent.

http://www.LoaderMax.com

QueueLoader – AS2

From the site:

I’ve written a helper class for loading and monitoring resources which is based upon an AS3 library called Queueloader located at Google Code. My version is written in AS2 and has the following features:

Individual monitoring
Overall queue monitoring
Image loading
SWF loading
MP3 loading

http://fboyle.com/blog/?p=17

BulkLoader

an As3 library for multiple loadings / preloadings. 
From the site:

Controlling loading is tedious, error prone, and each projects has such specific requirements that you end up rewriting loading code. A lot. In my last project I spent 4 hours debugging download code and promised my self I would solve this annoyance once and for all. So in the best “let me be lazy” fashion, I decided to write my final loading code.  

http://www.stimuli.com.br/trane/2007/nov/25/loading-reloaded/ 

QueueLoader AS3

QueueLoader is a sequential external asset loader with item and queue progress monitoring. Currently loads Images, Swf, and MP3 files.

http://blog.hydrotik.com/category/queueloader/

GIFPlayer

From the site:

After working with the GIF format in ActionScript 3 since a few days, I wanted to be able to load animated GIF’s into the player which is not possible for the moment. If you load a GIF file with the flash.display.Loader class you will only get the first frame of the animation.

With this new GIFPlayer class, everything is handled, I have added some methods as you would call on a traditional flash.display.MovieClip.

http://www.bytearray.org/?p=95 

AVM2Loader

From the site:

I made an AVM2Loader class, that loads AVM1 movie and converts to AVM2 movie!!
Its simply a subclass of the Loader class. Just use load and loadBytes method. AVM2Loader automatically changes internal bytecodes when swf is loaded. When AVM1 movie is converted to AVM2, logically all as2 script should be ignored

http://www.fladdict.net/blog-en/2007/06/avm2loader_class.html