Packageorg.puremvc.as3.utilities.loadup.assetloader.model
Classpublic class AssetProxy
InheritanceAssetProxy Inheritance org.puremvc.as3.patterns.proxy.Proxy
ImplementsILoadupProxy

This is a proxy class for an asset. It contains an IASSET object. It is created before the asset is loaded, and is involved in the loading. It implements ILoadupProxy so that the Loadup utility can be used to manage the asset loading.

After loading is complete, this proxy remains as a repository of the IASSET object.

It is intended that this proxy can act for a range of asset types, providing there is a suitable loader. As key to understanding the approach, see AssetTypeMapBase, FlexAssetTypeMap, AssetFactory and AssetLoaderFactory.

The loader class, of type IAssetLoader, has a Delegate type role. It works for this AssetProxy class and reports back to it.



Public Properties
 PropertyDefined by
  asset : IAsset
[read-only]
AssetProxy
  assetData : Object
[write-only]
AssetProxy
  url : String
[read-only]
AssetProxy
Protected Properties
 PropertyDefined by
  assetGroupProxy : AssetGroupProxy
AssetProxy
  bytesLoaded : Number = 0
AssetProxy
  bytesTotal : Number = 0
AssetProxy
  loaded : Boolean = false
AssetProxy
  loader : IAssetLoader
AssetProxy
  loadingCommenced : Boolean = false
AssetProxy
  loadingErrorMessage : String = ""
Contains the latest error message, if there is one.
AssetProxy
Public Methods
 MethodDefined by
  
AssetProxy(assetGroupProxy:AssetGroupProxy, proxyName:String, data:IAsset)
AssetProxy
  
getBytesLoaded():Number
AssetProxy
  
getBytesTotal():Number
AssetProxy
  
AssetProxy
  
isLoaded():Boolean
AssetProxy
  
AssetProxy
  
load():void
AssetProxy
  
loadingComplete(loadedData:Object):void
Responds to feedback from the loader object, that loading is complete.
AssetProxy
  
loadingIOError(errMsg:String):void
Responds to feedback from the loader object, that io error has occurred.
AssetProxy
  
loadingProgress(bytesLoaded:Number, bytesTotal:Number):void
The following suite of 'loading...' methods are callable from the loader object, based on loading events and outcomes.
AssetProxy
  
loadingSecurityError(errMsg:String):void
Responds to feedback from the loader object, that security error has occurred.
AssetProxy
Protected Methods
 MethodDefined by
  
doSendNotification(notificationName:String, body:Object = null):void
Notification type is the LoadupMonitorProxy's proxyName.
AssetProxy
Property detail
assetproperty
asset:IAsset  [read-only]Implementation
    public function get asset():IAsset
assetDataproperty 
assetData:Object  [write-only]Implementation
    public function set assetData(value:Object):void
assetGroupProxyproperty 
protected var assetGroupProxy:AssetGroupProxy
bytesLoadedproperty 
protected var bytesLoaded:Number = 0
bytesTotalproperty 
protected var bytesTotal:Number = 0
loadedproperty 
protected var loaded:Boolean = false
loaderproperty 
protected var loader:IAssetLoader
loadingCommencedproperty 
protected var loadingCommenced:Boolean = false
loadingErrorMessageproperty 
protected var loadingErrorMessage:String = ""

Contains the latest error message, if there is one.

urlproperty 
url:String  [read-only]Implementation
    public function get url():String
Constructor detail
AssetProxy()constructor
public function AssetProxy(assetGroupProxy:AssetGroupProxy, proxyName:String, data:IAsset)Parameters
assetGroupProxy:AssetGroupProxy
 
proxyName:String
 
data:IAsset
Method detail
doSendNotification()method
protected function doSendNotification(notificationName:String, body:Object = null):void

Notification type is the LoadupMonitorProxy's proxyName.

Parameters
notificationName:String
 
body:Object (default = null)

See also

getBytesLoaded()method 
public function getBytesLoaded():Number

Returns
Number
getBytesTotal()method 
public function getBytesTotal():Number

Returns
Number
getLoadingErrorMessage()method 
public function getLoadingErrorMessage():String

Returns
String
isLoaded()method 
public function isLoaded():Boolean

Returns
Boolean
isLoadingCommenced()method 
public function isLoadingCommenced():Boolean

Returns
Boolean
load()method 
public function load():void
loadingComplete()method 
public function loadingComplete(loadedData:Object):void

Responds to feedback from the loader object, that loading is complete. Send ASSET_LOADED note, absolutely essential to the Loadup utility. Send NEW_ASSET_AVAILABLE note, may be of interest to client app. Always include the notification type, to enable selection in client app.

Parameters
loadedData:Object
loadingIOError()method 
public function loadingIOError(errMsg:String):void

Responds to feedback from the loader object, that io error has occurred. Send ASSET_LOAD_FAILED note, absolutely essential to the Loadup utility. Send ASSET_LOAD_FAILED_IOERROR note, may be of interest to client app. Always include the notification type, to enable selection in client app.

Parameters
errMsg:String
loadingProgress()method 
public function loadingProgress(bytesLoaded:Number, bytesTotal:Number):void

The following suite of 'loading...' methods are callable from the loader object, based on loading events and outcomes. They are not for public use otherwise.

Parameters
bytesLoaded:Number
 
bytesTotal:Number
loadingSecurityError()method 
public function loadingSecurityError(errMsg:String):void

Responds to feedback from the loader object, that security error has occurred. Send ASSET_LOAD_FAILED note, absolutely essential to the Loadup utility. With this kind or error, tell the LU not to bother with retry. Send ASSET_LOAD_FAILED_SECURITY note, may be of interest to client app. Always include the notification type, to enable selection in client app.

Parameters
errMsg:String