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.
asset:IAsset [read-only]
Implementation
public function get asset():IAsset
assetData:Object [write-only]Implementation
public function set assetData(value:Object):void
protected var assetGroupProxy:AssetGroupProxy
protected var bytesLoaded:Number = 0
protected var bytesTotal:Number = 0
protected var loaded:Boolean = false
protected var loader:IAssetLoader
protected var loadingCommenced:Boolean = false
protected var loadingErrorMessage:String = ""
Contains the latest error message, if there is one.
url:String [read-only]Implementation
public function get url():String
public function AssetProxy(assetGroupProxy:AssetGroupProxy, proxyName:String, data:IAsset)Parameters
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
public function getBytesLoaded():Number
Returns
public function getBytesTotal():Number
Returns
public function getLoadingErrorMessage():String
Returns
public function isLoaded():Boolean
Returns
public function isLoadingCommenced():Boolean
Returns
public function load():void
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
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
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 |
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