/**
* VERSION: 1.7
* DATE: 2010-11-13
* AS3
* UPDATES AND DOCS AT: http://www.greensock.com/loadermax/
**/
package com.greensock.loading {
import com.greensock.loading.core.LoaderItem;
import flash.display.DisplayObject;
import flash.display.LoaderInfo;
import flash.events.Event;
import flash.events.ProgressEvent;
/**
* Tracks the loading progress of the swf in which the loader resides (basically a simple tool for tracking
* the loaderInfo
's progress). SelfLoader is only useful in situations where you want to factor
* the current swf's loading progress into a LoaderMax queue or maybe display a progress bar for the current
* swf or fire an event when loading has finished.
*
* OPTIONAL VARS PROPERTIES
* The following special properties can be passed into the SelfLoader constructor via its vars
parameter:
*
LoaderMax.getLoader()
or LoaderMax.getContent()
methods or traced at any time. Each loader's name should be unique. If you don't define one, a unique name will be created automatically, like "loader21".autoDispose
is true
, the loader will be disposed immediately after it completes (it calls the dispose()
method internally after dispatching its COMPLETE
event). This will remove any listeners that were defined in the vars object (like onComplete, onProgress, onError). Once a loader is disposed, it can no longer be found with LoaderMax.getLoader()
or LoaderMax.getContent()
. The default autoDispose
value is false
.
*
* LoaderEvent.PROGRESS
events which are dispatched whenever the bytesLoaded
changes. Make sure your onProgress function accepts a single parameter of type LoaderEvent
(com.greensock.events.LoaderEvent
). You can use the LoaderEvent's target.progress
to get the loader's progress value or use its target.bytesLoaded
and target.bytesTotal
.LoaderEvent.COMPLETE
events which are dispatched when the loader has finished loading successfully. Make sure your onComplete function accepts a single parameter of type LoaderEvent
(com.greensock.events.LoaderEvent
).loaderInfo
to track the loading progress).
* @param vars An object containing optional configuration details. For example: new SelfLoader(this, {name:"self", onComplete:completeHandler, onProgress:progressHandler})
.vars
parameter:LoaderMax.getLoader()
or LoaderMax.getContent()
methods or traced at any time. Each loader's name should be unique. If you don't define one, a unique name will be created automatically, like "loader21".autoDispose
is true
, the loader will be disposed immediately after it completes (it calls the dispose()
method internally after dispatching its COMPLETE
event). This will remove any listeners that were defined in the vars object (like onComplete, onProgress, onError). Once a loader is disposed, it can no longer be found with LoaderMax.getLoader()
or LoaderMax.getContent()
. The default autoDispose
value is false
.
*
* LoaderEvent.PROGRESS
events which are dispatched whenever the bytesLoaded
changes. Make sure your onProgress function accepts a single parameter of type LoaderEvent
(com.greensock.events.LoaderEvent
). You can use the LoaderEvent's target.progress
to get the loader's progress value or use its target.bytesLoaded
and target.bytesTotal
.LoaderEvent.COMPLETE
events which are dispatched when the loader has finished loading successfully. Make sure your onComplete function accepts a single parameter of type LoaderEvent
(com.greensock.events.LoaderEvent
).