Package | com.sibirjak.angara.resource |
Interface | public interface IResourceLoader extends ILoaderItem, IProgressInfo, flash.events.IEventDispatcher |
Subinterfaces | ILoaderDelegate, IURLLoaderDelegate |
Implementors | AbstractResourceLoader |
A resource loader is basically an adapter to any of the built-in Flash loader types (Loader, URLLoader, Sound, ...). This interface lets those loaders interact with the LoaderManager.
Property | Defined by | ||
---|---|---|---|
bytesLoaded : uint [read-only]
Returns the number of bytes already loaded.
| IResourceLoader | ||
bytesTotal : uint [read-only]
Returns the number of bytes total.
| IResourceLoader | ||
callbackFunction : Function [write-only]
Defines a callback function that will be executed right before the
ResourceLoaderEvent.COMPLETE event.
| IResourceLoader | ||
content : * [read-only]
Returns a reference to the loaded content.
| IResourceLoader | ||
failedLoadingTrials : uint [read-only]
Returns the number of failed loading trails.
| IResourceLoader | ||
httpStatus : int [read-only]
Returns the http status of a loaded resource.
| IResourceLoader | ||
![]() | itemType : String
The type of the loader item.
| ILoaderItem | |
![]() | key : String
Returns the identifying key of the loader item.
| ILoaderItem | |
loadingError : LoadingError
[read-only]
Returns the loading error in a ResourceLoaderEvent.FAILURE event.
| IResourceLoader | ||
maxLoadingTrials : uint
Returns the max number of trails in case of failures.
| IResourceLoader | ||
![]() | numItems : uint
Returns the number of items to be loaded within the loader item.
| IProgressInfo | |
![]() | numItemsFailed : uint
Returns the number of items failed within the loader item.
| IProgressInfo | |
![]() | numItemsLoaded : uint
Returns the number of items loaded within the loader item.
| IProgressInfo | |
![]() | progress : Number
Returns the progress of the loader item as a decimal value between zero and 1.
| IProgressInfo | |
![]() | scheduled : Boolean
Returns true, if the item already has been added to the loader manager
directly or to a sequence or a sequence manager.
| ILoaderItem | |
![]() | status : String
The current loading status.
| ILoaderItem | |
timeout : uint [write-only]
Specifies a timeout after that the resource loader will fail.
| IResourceLoader | ||
url : String [read-only]
Returns the URL of the resource loader.
| IResourceLoader |
Method | Defined by | ||
---|---|---|---|
getProperty(name:String):*
Lets you pull a prior specified runtime property.
| IResourceLoader | ||
load():void
Starts loading of the resource.
| IResourceLoader | ||
![]() |
pause():void
Marks the item to be ignored by subsequent loader manager queue pulling operations.
| ILoaderItem | |
![]() |
resume():void
Marks a prior paused item to be eligible for loader manager queue polling
operations.
| ILoaderItem | |
setProperty(name:String, value:*):void
Lets you specify an arbitrary runtime property to be available within
each resource loader event.
| IResourceLoader | ||
![]() |
stop():void
Immediately stops loading of the item or its containing items.
| ILoaderItem |
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]Defines a callback function that will be executed right before the ResourceLoaderEvent.COMPLETE event.
Implementation public function set callbackFunction(value:Function):void
See also
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 |
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 |
loadingError:LoadingError
[read-only]Returns the loading error in a ResourceLoaderEvent.FAILURE event.
Implementation public function get loadingError():LoadingError
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
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
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.
|
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.
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.
|