Package | com.sibirjak.angara.resource |
Class | public class AbstractResourceLoader |
Inheritance | AbstractResourceLoader ![]() ![]() ![]() |
Implements | IResourceLoader |
Subclasses | LoaderDelegate, URLLoaderDelegate |
Property | Defined by | ||
---|---|---|---|
bytesLoaded : uint [read-only]
Returns the number of bytes already loaded.
| AbstractResourceLoader | ||
bytesTotal : uint [read-only]
Returns the number of bytes total.
| AbstractResourceLoader | ||
callbackFunction : Function [write-only]
| AbstractResourceLoader | ||
content : * [read-only]
Returns a reference to the loaded content.
| AbstractResourceLoader | ||
failedLoadingTrials : uint [read-only]
Returns the number of failed loading trails.
| AbstractResourceLoader | ||
httpStatus : int [read-only]
Returns the http status of a loaded resource.
| AbstractResourceLoader | ||
![]() | itemType : String
The type of the loader item.
| AbstractLoaderItem | |
![]() | key : String
Returns the identifying key of the loader item.
| AbstractLoaderItem | |
loadingError : LoadingError
[read-only]
Returns the loading error in a ResourceLoaderEvent.FAILURE event.
| AbstractResourceLoader | ||
maxLoadingTrials : uint
Returns the max number of trails in case of failures.
| AbstractResourceLoader | ||
![]() | numItems : uint
Returns the number of items to be loaded within the loader item.
| AbstractProgressInfo | |
![]() | numItemsFailed : uint
Returns the number of items failed within the loader item.
| AbstractProgressInfo | |
![]() | numItemsLoaded : uint
Returns the number of items loaded within the loader item.
| AbstractProgressInfo | |
![]() | progress : Number
Returns the progress of the loader item as a decimal value between zero and 1.
| AbstractProgressInfo | |
![]() | scheduled : Boolean
Returns true, if the item already has been added to the loader manager
directly or to a sequence or a sequence manager.
| AbstractLoaderItem | |
![]() | status : String
The current loading status.
| AbstractLoaderItem | |
timeout : uint [write-only]
Specifies a timeout after that the resource loader will fail.
| AbstractResourceLoader | ||
url : String [read-only]
Returns the URL of the resource loader.
| AbstractResourceLoader |
Property | Defined by | ||
---|---|---|---|
_failedLoadingTrials : uint = 0
Number of failed loading trials.
| AbstractResourceLoader | ||
![]() | _isScheduled : Boolean = false
The schedule marker.
| AbstractLoaderItem | |
![]() | _key : String
The key used for debugging purposes.
| AbstractLoaderItem | |
_loadingError : LoadingError
Loading error information.
| AbstractResourceLoader | ||
_loadingTrials : uint = 0
Number of loading trials already done.
| AbstractResourceLoader | ||
![]() | _numItems : uint = 0
The number of items added.
| AbstractProgressInfo | |
![]() | _numItemsFailed : uint = 0
The number of items failed loading.
| AbstractProgressInfo | |
![]() | _numItemsLoaded : uint = 0
The number of items alredy loaded.
| AbstractProgressInfo | |
![]() | _progress : Number = 0
The overall progress of the item.
| AbstractProgressInfo | |
_request : URLRequest
The request.
| AbstractResourceLoader | ||
![]() | _status : String
The loader item status.
| AbstractLoaderItem | |
![]() | _type : String
The loader item type.
| AbstractLoaderItem |
Method | Defined by | ||
---|---|---|---|
AbstractResourceLoader(request:URLRequest)
Constructor
| AbstractResourceLoader | ||
getProperty(name:String):*
Lets you pull a prior specified runtime property.
| AbstractResourceLoader | ||
load():void
Starts loading of the resource.
| AbstractResourceLoader | ||
pause():void
Marks the item to be ignored by subsequent loader manager queue pulling operations.
| AbstractResourceLoader | ||
resume():void
Marks a prior paused item to be eligible for loader manager queue polling
operations.
| AbstractResourceLoader | ||
setProperty(name:String, value:*):void
Lets you specify an arbitrary runtime property to be available within
each resource loader event.
| AbstractResourceLoader | ||
stop():void
Immediately stops loading of the item or its containing items.
| AbstractResourceLoader |
Method | Defined by | ||
---|---|---|---|
clear():Boolean
Template method to clean up all internal loader references.
| AbstractResourceLoader | ||
dispatchComplete():void
Dispatches the ResourceLoaderEvent.COMPLETE event.
| AbstractResourceLoader | ||
dispatchFailure():void
Dispatches the ResourceLoaderEvent.FAILURE event.
| AbstractResourceLoader | ||
dispatchInit():void
Dispatches the ResourceLoaderEvent.INIT event.
| AbstractResourceLoader | ||
dispatchLoading():void
Dispatches the ResourceLoaderEvent.LOADING event.
| AbstractResourceLoader | ||
dispatchLoadingTrialFailure():void
Dispatches the ResourceLoaderEvent.TRIAL_FAILURE event.
| AbstractResourceLoader | ||
dispatchPause():void
Dispatches the ResourceLoaderEvent.PAUSE event.
| AbstractResourceLoader | ||
dispatchProgress():void
Dispatches the ResourceLoaderEvent.PROGRESS event.
| AbstractResourceLoader | ||
dispatchResume():void
Dispatches the ResourceLoaderEvent.RESUME event.
| AbstractResourceLoader | ||
dispatchStop():void
Dispatches the ResourceLoaderEvent.STOP event.
| AbstractResourceLoader | ||
notifyComplete(content:*):void
A subclass must call notifyComplete in all cases the loading of the
resource has been finished successfully.
| AbstractResourceLoader | ||
notifyFailure(errorType:String, failureMessage:String, error:Error = null):void
A subclass must call notifyFailure in all cases the loading of the
resource cannot be accomplished.
| AbstractResourceLoader | ||
notifyHttpStatus(status:int):void
A subclass may call notifyHttpStatus to store a http status code.
| AbstractResourceLoader | ||
notifyInit(content:*):void
A subclass may call notifyInit if the content is ready for display
or any other use.
| AbstractResourceLoader | ||
notifyProgress(bytesTotal:uint = 0, bytesLoaded:uint = 0):void
A subclass may call notifyProgress to inform the clients about
a change in progess.
| AbstractResourceLoader | ||
startLoading():void
Template method to set up all internal loader references and start loading.
| AbstractResourceLoader |
bytesLoaded | property |
bytesLoaded:uint
[read-only]Returns the number of bytes already loaded.
Implementation public function get bytesLoaded():uint
bytesTotal | property |
bytesTotal:uint
[read-only]Returns the number of bytes total.
Note this is only available after a net connection has been established and
the resource information has been received and the http response contains a
file size property. In all other cases this method will return zero unit the
resource is completely loaded from the server.
Implementation
public function get bytesTotal():uint
callbackFunction | property |
callbackFunction:Function
[write-only]Implementation
public function set callbackFunction(value:Function):void
content | property |
content:*
[read-only]Returns a reference to the loaded content.
For streaming types the content will be available not before the
INIT event has been dispatched. For static types the content won't be
available until the resource has been loaded completely from the remote
destination.
Implementation
public function get content():*
_failedLoadingTrials | property |
protected var _failedLoadingTrials:uint = 0
Number of failed loading trials.
failedLoadingTrials | property |
failedLoadingTrials:uint
[read-only]Returns the number of failed loading trails.
Implementation public function get failedLoadingTrials():uint
httpStatus | property |
httpStatus:int
[read-only]Returns the http status of a loaded resource.
Initial value is -1.
Loading from a local realm will set the http status to 0.
Loading from a not permitted remote realm will set the http status to 0.
Implementation public function get httpStatus():int
_loadingError | property |
protected var _loadingError:LoadingError
Loading error information.
loadingError | property |
loadingError:LoadingError
[read-only]Returns the loading error in a ResourceLoaderEvent.FAILURE event.
Implementation public function get loadingError():LoadingError
_loadingTrials | property |
protected var _loadingTrials:uint = 0
Number of loading trials already done.
maxLoadingTrials | property |
maxLoadingTrials:uint
[read-write]Returns the max number of trails in case of failures.
Implementation public function get maxLoadingTrials():uint
public function set maxLoadingTrials(value:uint):void
_request | property |
protected var _request:URLRequest
The request.
timeout | property |
timeout:uint
[write-only]Specifies a timeout after that the resource loader will fail.
If the resource loader does not show any raise in progress within this timeout, the loader will try to restart loading the resource as often as specified in connectionTrials. If the number of connectionTrials has been reached, the loader will be marked as failed and dispatch a ResourceLoaderEvent.FAILURE.
Default value is 1000 ms = 1 second.
Implementation public function set timeout(value:uint):void
url | property |
url:String
[read-only]Returns the URL of the resource loader.
Implementation public function get url():String
AbstractResourceLoader | () | constructor |
public function AbstractResourceLoader(request:URLRequest)
Constructor
Parametersrequest:URLRequest — The request.
|
callbackFinished | () | method |
sibirjak_loader function callbackFinished():void
Framework internal method to notify the resource loader about the completion of the callback.
Will be invoked by the internal Callback instance.
clear | () | method |
protected function clear():Boolean
Template method to clean up all internal loader references.
An implementor should clean up here all listeners to its particular internal loader and call its clear method.
After a reset() invokation the loader must not dispatch any further loading event.
ReturnsBoolean |
dispatchComplete | () | method |
protected function dispatchComplete():void
Dispatches the ResourceLoaderEvent.COMPLETE event.
dispatchFailure | () | method |
protected function dispatchFailure():void
Dispatches the ResourceLoaderEvent.FAILURE event.
dispatchInit | () | method |
protected function dispatchInit():void
Dispatches the ResourceLoaderEvent.INIT event.
dispatchLoading | () | method |
protected function dispatchLoading():void
Dispatches the ResourceLoaderEvent.LOADING event.
dispatchLoadingTrialFailure | () | method |
protected function dispatchLoadingTrialFailure():void
Dispatches the ResourceLoaderEvent.TRIAL_FAILURE event.
dispatchPause | () | method |
protected function dispatchPause():void
Dispatches the ResourceLoaderEvent.PAUSE event.
dispatchProgress | () | method |
protected function dispatchProgress():void
Dispatches the ResourceLoaderEvent.PROGRESS event.
dispatchResume | () | method |
protected function dispatchResume():void
Dispatches the ResourceLoaderEvent.RESUME event.
dispatchStop | () | method |
protected function dispatchStop():void
Dispatches the ResourceLoaderEvent.STOP event.
getProperty | () | method |
public function getProperty(name:String):*
Lets you pull a prior specified runtime property.
Parametersname:String — The name of the property.
|
* — The value of the property to get.
|
hasCallback | () | method |
sibirjak_loader function hasCallback():Boolean
Framework internal method to detect, if a callback has been defined to this resource loader.
ReturnsBoolean — true, if a callback is defined.
|
load | () | method |
public function load():void
Starts loading of the resource.
Won't have any effect if the status is any other than LoaderItemStatus.WAITING.
notifyComplete | () | method |
protected function notifyComplete(content:*):void
A subclass must call notifyComplete in all cases the loading of the resource has been finished successfully.
Executes the callback before the final COMPLETE event is dispatched.
Parameterscontent:* — The loaded content.
|
notifyFailure | () | method |
protected final function notifyFailure(errorType:String, failureMessage:String, error:Error = null):void
A subclass must call notifyFailure in all cases the loading of the resource cannot be accomplished.
ParameterserrorType:String — The detailed failure description.
|
|
failureMessage:String |
|
error:Error (default = null )
|
notifyHttpStatus | () | method |
protected final function notifyHttpStatus(status:int):void
A subclass may call notifyHttpStatus to store a http status code.
Parametersstatus:int — The status code.
|
notifyInit | () | method |
protected function notifyInit(content:*):void
A subclass may call notifyInit if the content is ready for display or any other use.
Parameterscontent:* — The loaded content.
|
notifyProgress | () | method |
protected final function notifyProgress(bytesTotal:uint = 0, bytesLoaded:uint = 0):void
A subclass may call notifyProgress to inform the clients about a change in progess.
ParametersbytesTotal:uint (default = 0 ) — The loaded content.
|
|
bytesLoaded:uint (default = 0 )
|
pause | () | method |
public override function pause():void
Marks the item to be ignored by subsequent loader manager queue pulling operations.
Sets the items status to LoaderItemStatus.PAUSED. Does only have effect to items which status is LoaderItemStatus.WAITING. You cannot pause a loading or finished item. To interrupt loading you need to call stop() for the particular item.
If the item is of type LoaderItemType.SEQUENCE, only the sequence will be marked as paused.
If the item is of type LoaderItemType.SEQUENCE_MANAGER, only the sequence manager will be marked as paused.
resume | () | method |
public override function resume():void
Marks a prior paused item to be eligible for loader manager queue polling operations.
Sets the items status to LoaderItemStatus.WAITING. Does only have effect to items which status is LoaderItemStatus.PAUSED.
If the item is of type LoaderItemType.SEQUENCE, only the sequence's status will be affected.
If the item is of type LoaderItemType.SEQUENCE_MANAGER, only the sequence manager's status will be affected.
setProperty | () | method |
public function setProperty(name:String, value:*):void
Lets you specify an arbitrary runtime property to be available within each resource loader event.
Parametersname:String — The name of the property.
|
|
value:* — The value of the property.
|
startLoading | () | method |
protected function startLoading():void
Template method to set up all internal loader references and start loading.
An implementor should set up here all listeners to its particular internal loader and invoke its load method.
stop | () | method |
public override function stop():void
Immediately stops loading of the item or its containing items.
If the item is of type LoaderItemType.LOADER and is currently being loading, the associated net connection will be closed. Does only have effect to resource loaders, which status is LoaderItemStatus.LOADING. Sets the loader status back to LoaderItemStatus.WAITING. You cannot stop finished loaders (LoaderItemStatus.COMPLETE, LoaderItemStatus.FAILURE) any more.
If the item is of type LoaderItemType.SEQUENCE, all open loaders assigned to the seqeunce will be stopped.
If the item is of type LoaderItemType.SEQUENCE_MANAGER, the stop method of all assigned sequences will be called.