Packagecom.sibirjak.angara.resource
Interfacepublic interface IResourceLoader extends ILoaderItem, IProgressInfo, flash.events.IEventDispatcher
SubinterfacesILoaderDelegate, IURLLoaderDelegate
ImplementorsAbstractResourceLoader

Defines the interface of a resource loader item.

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.



Public Properties
 PropertyDefined 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
 InheriteditemType : String
The type of the loader item.
ILoaderItem
 Inheritedkey : 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
 InheritednumItems : uint
Returns the number of items to be loaded within the loader item.
IProgressInfo
 InheritednumItemsFailed : uint
Returns the number of items failed within the loader item.
IProgressInfo
 InheritednumItemsLoaded : uint
Returns the number of items loaded within the loader item.
IProgressInfo
 Inheritedprogress : Number
Returns the progress of the loader item as a decimal value between zero and 1.
IProgressInfo
 Inheritedscheduled : Boolean
Returns true, if the item already has been added to the loader manager directly or to a sequence or a sequence manager.
ILoaderItem
 Inheritedstatus : 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
Public Methods
 MethodDefined by
  
getProperty(name:String):*
Lets you pull a prior specified runtime property.
IResourceLoader
  
load():void
Starts loading of the resource.
IResourceLoader
 Inherited
pause():void
Marks the item to be ignored by subsequent loader manager queue pulling operations.
ILoaderItem
 Inherited
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
 Inherited
stop():void
Immediately stops loading of the item or its containing items.
ILoaderItem
Property detail
bytesLoadedproperty
bytesLoaded:uint  [read-only]

Returns the number of bytes already loaded.

Implementation
    public function get bytesLoaded():uint
bytesTotalproperty 
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

callbackFunctionproperty 
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

contentproperty 
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():*

failedLoadingTrialsproperty 
failedLoadingTrials:uint  [read-only]

Returns the number of failed loading trails.

Implementation
    public function get failedLoadingTrials():uint
httpStatusproperty 
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
loadingErrorproperty 
loadingError:LoadingError  [read-only]

Returns the loading error in a ResourceLoaderEvent.FAILURE event.

Implementation
    public function get loadingError():LoadingError
maxLoadingTrialsproperty 
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
timeoutproperty 
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
urlproperty 
url:String  [read-only]

Returns the URL of the resource loader.

Implementation
    public function get url():String
Method detail
getProperty()method
public function getProperty(name:String):*

Lets you pull a prior specified runtime property.

Parameters
name:String — The name of the property.

Returns
* — 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.

Parameters
name:String — The name of the property.
 
value:* — The value of the property.