Packagede.mightypirates.utils.interfaces
Interfacepublic interface IResourceProvider
ImplementorsResourceProvider

Interface to the ResourceProvider class. See class itself for more information.



Public Properties
 PropertyDefined by
  basePath : String
Base path used to resolve relative URLs.
IResourceProvider
  bundles : Vector
[read-only] All resource bundles known by this provider.
IResourceProvider
Public Methods
 MethodDefined by
  
addBundle(bundle:IResourceBundle, priority:uint = 0):void
Adds a new bundle with the given priority.
IResourceProvider
  
basePathFromLoaderInfo(loaderInfo:LoaderInfo):void
Sets the basePath by extracting the proper path from the URL of the containing SWF.
IResourceProvider
  
load(request:URLRequest, datatype:String, context:int = null, priority:* = 0):IResourceLoader
Starts loading a resource from the given location and returns an object allowing to track the progress.
IResourceProvider
  
Removes the given bundle from the list of known resource bundles, if it is known.
IResourceProvider
Property detail
basePathproperty
basePath:String  [read-write]

Base path used to resolve relative URLs.

Implementation
    public function get basePath():String
    public function set basePath(value:String):void
bundlesproperty 
bundles:Vector  [read-only]

All resource bundles known by this provider.

IMPORTANT: this generates a new vector on each call, so store it where appropriate.

Implementation
    public function get bundles():Vector
Method detail
addBundle()method
public function addBundle(bundle:IResourceBundle, priority:uint = 0):void

Adds a new bundle with the given priority.

Resource bundles with higher priority will be queried first. The order of two bundles with the same priority is undefined (can be random).

If this bundle had been added before, it'll be removed before the insert, to avoid duplicate entries.

Parameters
bundle:IResourceBundle — the resource bundle to add.
 
priority:uint (default = 0) — the priority with which the bundle should be queried.
basePathFromLoaderInfo()method 
public function basePathFromLoaderInfo(loaderInfo:LoaderInfo):void

Sets the basePath by extracting the proper path from the URL of the containing SWF.

Parameters
loaderInfo:LoaderInfo
load()method 
public function load(request:URLRequest, datatype:String, context:int = null, priority:* = 0):IResourceLoader

Starts loading a resource from the given location and returns an object allowing to track the progress.

The function must not throw for any other reason, instead an error event should be thrown.

Parameters
request:URLRequest — the url from which to load the resource (identifier).
 
datatype:String — the resource type.
 
context:int (default = null) — loader context to use for some loaders. Note that some resource bundles may choose to ignore this parameter.
 
priority:* (default = 0) — an optional urgency that this request should be processed with, where higher means less urgent. This may be ignored by certain ResourceBundle implementations.

Returns
IResourceLoader — a loader object which can be used to track the progress.

Throws
— if the given datatype is not supported by any of the resource bundles registered with the provider, or if the data type is set to 'automatic' but cannot be resolved.
removeBundle()method 
public function removeBundle(bundle:IResourceBundle):void

Removes the given bundle from the list of known resource bundles, if it is known.

Parameters
bundle:IResourceBundle — the resource bundle to remove.