|
Project Information
Featured
Downloads
Links
|
ActionScript3 PreLoader Class with queueWe (Philipp and me) have been using the PreLoader class as a Loader replacement for years now to load asset content (swfs and images). The PreLoader has an integrated loader queue which allows one loading process at a time. It also has some convenient features like smoothing images when scaling them down. The PreLoader class is not a visual preloader! You as a developer still have to do the dirty work like listening for progress and complete events and react to them. However, you can concentrate on that work without all the (from our point) useless overhead like contentLoaderInfo and URLRequest. Example implementation:var img:PreLoader = new PreLoader();
img.addEventListener(ProgressEvent.PROGRESS, _onImgProgress);
img.addEventListener(Event.COMPLETE, _onImgLoaded);
img.load("image1.jpg");
addChild(img);
function _onImgProgress(event : ProgressEvent)
{
var perc:Number = event.bytesLoaded / event.bytesTotal;
trace(perc);
}
function _onImgLoaded(event : Event)
{
trace("image loaded");
}Difference to LoaderHere you find the DifferenceToLoader. Example scenarioHere you find a TypicalScenario. Code documentationYou can find the API documentation here. What the PreLoader can do for you:
What the PreLoader will not do for you:
ContributeWe have been working a lot with the PreLoader class. It can be called "well tested". However, if you find an issue or miss a feature, please let us know. |