Package | com.greensock.loading.data.core |
Class | public dynamic class LoaderCoreVars |
Subclasses | LoaderItemVars, LoaderMaxVars |
vars
object that's passed into the
constructor of various loaders in the LoaderMax system. There is no reason to use this class directly - see
docs for the vars classes that extend LoaderCoreVars like XMLLoaderVars, SWFLoaderVars, LoaderMaxVars, etc.Property | Defined by | ||
---|---|---|---|
autoDispose : Boolean When
autoDispose is true , the loader will be disposed immediately after it completes (it calls the dispose() method internally after dispatching its COMPLETE event). | LoaderCoreVars | ||
name : String A name that is used to identify the loader instance.
| LoaderCoreVars | ||
onCancel : Function A handler function for
LoaderEvent.CANCEL events which are dispatched when loading is aborted due to either a failure or because another loader was prioritized or cancel() was manually called. | LoaderCoreVars | ||
onComplete : Function A handler function for
LoaderEvent.COMPLETE events which are dispatched when the loader has finished loading successfully. | LoaderCoreVars | ||
onError : Function A handler function for
LoaderEvent.ERROR events which are dispatched whenever the loader experiences an error (typically an IO_ERROR or SECURITY_ERROR). | LoaderCoreVars | ||
onFail : Function A handler function for
LoaderEvent.FAIL events which are dispatched whenever the loader fails and its status changes to LoaderStatus.FAILED . | LoaderCoreVars | ||
onHTTPStatus : Function A handler function for
LoaderEvent.HTTP_STATUS events. | LoaderCoreVars | ||
onIOError : Function A handler function for
LoaderEvent.IO_ERROR events which will also call the onError handler, so you can use that as more of a catch-all whereas onIOError is specifically for LoaderEvent.IO_ERROR events. | LoaderCoreVars | ||
onOpen : Function A handler function for
LoaderEvent.OPEN events which are dispatched when the loader begins loading. | LoaderCoreVars | ||
onProgress : Function A handler function for
LoaderEvent.PROGRESS events which are dispatched whenever the bytesLoaded changes. | LoaderCoreVars | ||
requireWithRoot : DisplayObject LoaderMax supports subloading, where an object can be factored into a parent's loading progress.
| LoaderCoreVars |
autoDispose | property |
public var autoDispose:Boolean
When 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, onInit). Once a loader is disposed, it can no longer be found with LoaderMax.getLoader()
or LoaderMax.getContent()
- it is essentially destroyed but its content is not unloaded (you must call unload()
or dispose(true)
to unload its content). The default autoDispose
value is false
.
name | property |
public var name:String
A name that is used to identify the loader instance. This name can be fed to the 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".
onCancel | property |
public var onCancel:Function
A handler function for LoaderEvent.CANCEL
events which are dispatched when loading is aborted due to either a failure or because another loader was prioritized or cancel()
was manually called. Make sure your onCancel function accepts a single parameter of type LoaderEvent
(com.greensock.events.LoaderEvent
).
onComplete | property |
public var onComplete:Function
A handler function for 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
).
onError | property |
public var onError:Function
A handler function for LoaderEvent.ERROR
events which are dispatched whenever the loader experiences an error (typically an IO_ERROR or SECURITY_ERROR). An error doesn't necessarily mean the loader failed, however - to listen for when a loader fails, use the onFail
special property. Make sure your onError function accepts a single parameter of type LoaderEvent
(com.greensock.events.LoaderEvent
).
onFail | property |
public var onFail:Function
A handler function for LoaderEvent.FAIL
events which are dispatched whenever the loader fails and its status
changes to LoaderStatus.FAILED
. Make sure your onFail function accepts a single parameter of type LoaderEvent
(com.greensock.events.LoaderEvent
).
onHTTPStatus | property |
public var onHTTPStatus:Function
A handler function for LoaderEvent.HTTP_STATUS
events. Make sure your onHTTPStatus function accepts a single parameter of type LoaderEvent
(com.greensock.events.LoaderEvent
). You can determine the httpStatus code using the LoaderEvent's target.httpStatus
(LoaderItems keep track of their httpStatus
when possible, although certain environments prevent Flash from getting httpStatus information).
onIOError | property |
public var onIOError:Function
A handler function for LoaderEvent.IO_ERROR
events which will also call the onError handler, so you can use that as more of a catch-all whereas onIOError
is specifically for LoaderEvent.IO_ERROR events. Make sure your onIOError function accepts a single parameter of type LoaderEvent
(com.greensock.events.LoaderEvent
).
onOpen | property |
public var onOpen:Function
A handler function for LoaderEvent.OPEN
events which are dispatched when the loader begins loading. Make sure your onOpen function accepts a single parameter of type LoaderEvent
(com.greensock.events.LoaderEvent
).
onProgress | property |
public var onProgress:Function
A handler function for 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
.
requireWithRoot | property |
public var requireWithRoot:DisplayObject
LoaderMax supports subloading, where an object can be factored into a parent's loading progress. If you want LoaderMax to require this loader as part of its parent SWFLoader's progress, you must set the requireWithRoot
property to your swf's root
. For example, vars.requireWithRoot = this.root;
.