Abstract class. Subclasses must set the
map property; see class FlexAssetTypeMap
as an example.
An asset must have a type; the default types are Image, Text, Swf, Sound and Video.
Each asset type maps to...
- an asset class
- an asset loader class
- a LoaderContext object (optional)
- a URLRequest object (optional)
- a loader dataFormat object (optional).
LoaderContext is relevant when Loader.load() requires a non-null context argument.
URLRequest is relevant, as used by loaders, when it requires particular property settings,
for example, the requestHeaders property.
Loader dataFormat is relevant when the loader is required to use a dataFormat other than its default.
It is assumed that a type that maps to a LoaderContext object, must also map to the
AssetLoadByLoader class in the main map. Likewise, it is assumed that a type that maps to a
loader dataFormat object, must also map to the AssetLoadByURLLoader class in the main map.
protected var map:Object
Must be populated by a subclass, with each property being set by a statement like the following
map[ asset type string ] = [ asset type class, asset type loader ];
See class FlexAssetTypeMap as an example of a subclass.
protected var mapToLoaderContext:Object
Could be empty, only use when required.
protected var mapToLoaderDataFormat:Object
Could be empty, only use when required.
protected var mapToURLRequest:Object
Could be empty, only use when required.
public function AssetTypeMapBase(mapToLoaderContext:Object = null, mapToURLRequest:Object = null, mapToLoaderDataFormat:Object = null)Parameters
| mapToLoaderContext:Object (default = null) |
| |
| mapToURLRequest:Object (default = null) |
| |
| mapToLoaderDataFormat:Object (default = null) |
protected function defaultMapToLoaderContext():Object
Returns
protected function defaultMapToLoaderDataFormat():Object
Returns
protected function defaultMapToURLRequest():Object
Returns
public function getAssetClass(assetType:String):ClassParameters
Returns
public function getAssetLoaderClass(assetType:String):ClassParameters
Returns
public function getLoaderContext(assetType:String):*Parameters
Returns
public function getLoaderDataFormat(assetType:String):StringParameters
Returns
public function getURLRequest(assetType:String):URLRequestParameters
Returns