Package | impression.resolver |
Class | public class AssetResolver |
Inheritance | AssetResolver ![]() |
Property | Defined By | ||
---|---|---|---|
path : String
The base URI for assets. | AssetResolver | ||
resolverInfo : ResolverInfo [read-only]
The ResolverInfo object for the resolver. | AssetResolver |
Method | Defined By | ||
---|---|---|---|
AssetResolver(path:String = null)
Creates a new instance of the AssetResolver class. | AssetResolver | ||
beginOwnerTransaction(owner:*, clearHistory:Boolean = true):void
Places an owner into transaction mode. | AssetResolver | ||
beginTransaction(clearHistory:Boolean = true):void
Places the resolver into transaction mode. | AssetResolver | ||
cancelOwnerTransaction(owner:*):void
Cancels a transaction started with the beginOwnerTransaction() method. | AssetResolver | ||
cancelTransaction():void
Cancels a transaction started with the beginTransaction() method. | AssetResolver | ||
closeAll():void
Closes all of the active items. | AssetResolver | ||
closeAllOf(owner:* = null):void
Closes all of the active items for an owner. | AssetResolver | ||
endOwnerTransaction(owner:*):void
Completes a transaction started with the beginOwnerTransaction() method. | AssetResolver | ||
endTransaction():void
Completes a transaction started with the beginTransaction() method. | AssetResolver | ||
getOwnerInfo(owner:*):ResolverInfo
Returns the ResolverInfo object for the owner. | AssetResolver | ||
getURLRequest(item:*):URLRequest
Returns a URLRequest object for an item. | AssetResolver | ||
load(item:*, loader:*, owner:* = null, context:* = null):void
Begins loading content into an object. | AssetResolver | ||
registerOwner(owner:*):ResolverInfo
Registers an object as an owner with this resolver. | AssetResolver | ||
resolveFilename(item:*):String
Returns a fully qualified URI for an item. | AssetResolver | ||
unregisterOwner(owner:*):void
Unregisters an object as an owner with this resolver. | AssetResolver |
path | property |
path:String
The base URI for assets.
The path
property value is appended to the filename
property
of an AssetData object, resulting in a fully-qualified URI to use to load the asset.
If the path
property value is set to null
, the empty string
("") is used instead.
public function get path():String
public function set path(value:String):void
See also
resolverInfo | property |
resolverInfo:ResolverInfo
[read-only] The ResolverInfo object for the resolver.
The ResolverInfo object returned provides aggregate statistics and extended event information for all content objects that use this resolver.
public function get resolverInfo():ResolverInfo
See also
AssetResolver | () | Constructor |
public function AssetResolver(path:String = null)
Creates a new instance of the AssetResolver class.
Parameterspath:String (default = null ) — A String specifying the base URI for assets. The path is appended to the filename
property of an AssetData object, resulting in a fully-qualified URI to use to load the asset.
|
beginOwnerTransaction | () | method |
public function beginOwnerTransaction(owner:*, clearHistory:Boolean = true):void
Places an owner into transaction mode.
In transaction mode, the ResolverInfo object for the owner will dispatch two additional events,
the ResolverEvent.BEGIN_TRANSACTION
event and the ResolverEvent.END_TRANSACTION
event. The
ResolverEvent.BEGIN_TRANSACTION
event will be dispatched when the first content object that has
owner
as its owner
property value dispatches the ResolverEvent.BEGIN
event. The
ResolverEvent.END_TRANSACTION
event will be dispatched when the last content object that has
owner
as its owner
property value dispatches the ResolverEvent.END
event, or the
endOwnerTransaction()
method is invoked, whichever occurs last.
If clearHistory
is true
, the aggregate statistics of the owner's ResolverInfo object are
reset. If clearHistory
is false
, only the aggregate statistics of the active items of the
owner's ResolverInfo object are reset.
Parameters
owner:* — The owner to place into transaction mode.
| |
clearHistory:Boolean (default = true ) — Specifies which aggregate statistics are reset.
|
ArgumentError — owner is not registered (ArgumentError).
| |
ArgumentError — owner cannot be null (ArgumentError).
|
See also
beginTransaction | () | method |
public function beginTransaction(clearHistory:Boolean = true):void
Places the resolver into transaction mode.
In transaction mode, the ResolverInfo object for the current AssetResolver will dispatch two additional events,
the ResolverEvent.BEGIN_TRANSACTION
event and the ResolverEvent.END_TRANSACTION
event. The
ResolverEvent.BEGIN_TRANSACTION
event will be dispatched when the first content object using this
resolver dispatches the ResolverEvent.BEGIN
event. The ResolverEvent.END_TRANSACTION
event will be dispatched when the last content object using this resolver dispatches the ResolverEvent.END
event, or the endTransaction()
method is invoked, whichever occurs last.
If clearHistory
is true
, the aggregate statistics of the resolverss ResolverInfo object are
reset. If clearHistory
is false
, only the aggregate statistics of the active items of the
resolver's ResolverInfo object are reset.
Parameters
clearHistory:Boolean (default = true ) — Specifies which aggregate statistics are reset.
|
See also
cancelOwnerTransaction | () | method |
public function cancelOwnerTransaction(owner:*):void
Cancels a transaction started with the beginOwnerTransaction()
method.
If the transaction is cancelled, the ResolverInfo object will not dispatch the
ResolverEvent.END_TRANSACTION
event.
If a transaction is not active, invoking this method has no effect.
Parameters
owner:* — The owner to cancel transaction mode for.
|
ArgumentError — owner is not registered (ArgumentError).
| |
ArgumentError — owner cannot be null (ArgumentError).
|
See also
cancelTransaction | () | method |
public function cancelTransaction():void
Cancels a transaction started with the beginTransaction()
method.
If the transaction is cancelled, the ResolverInfo object will not dispatch the
ResolverEvent.END_TRANSACTION
event.
If a transaction is not active, invoking this method has no effect.
See also
closeAll | () | method |
public function closeAll():void
Closes all of the active items.
This method iterates through each object currently loading data that uses this resolver and invokes the
close()
method on the object.
See also
closeAllOf | () | method |
public function closeAllOf(owner:* = null):void
Closes all of the active items for an owner.
This method iterates through each object currently loading data that uses this resolver and, if the object's
owner
property matches the value of the owner
parameter, invokes the close()
method on the object.
If owner
is null
, active items whose owner
property is null
will
be closed. If no active items can be found with a matching owner, invoking this method has no effect.
Parameters
owner:* (default = null ) — The owner whose active items should be closed. This value may be null .
|
endOwnerTransaction | () | method |
public function endOwnerTransaction(owner:*):void
Completes a transaction started with the beginOwnerTransaction()
method.
The endOwnerTransaction()
method must be called so that the owner's
ResolverInfo object can determine when to dispatch the ResolverEvent.END_TRANSACTION
event.
If a transaction is not active, invoking this method has no effect.
Parameters
owner:* — The owner to complete transaction mode for.
|
ArgumentError — owner is not registered (ArgumentError).
| |
ArgumentError — owner cannot be null (ArgumentError).
|
See also
endTransaction | () | method |
public function endTransaction():void
Completes a transaction started with the beginTransaction()
method.
The endTransaction()
method must be called so that the ResolverInfo
object can determine when to dispatch the ResolverEvent.END_TRANSACTION
event.
If a transaction is not active, invoking this method has no effect.
See also
getOwnerInfo | () | method |
public function getOwnerInfo(owner:*):ResolverInfo
Returns the ResolverInfo object for the owner
. If owner
has
not been register with this resolver, it is registered.
If there is no ResolverInfo for the owner
,
a new ResolverInfo object will be created.
Parameters
owner:* — The owner of the return value.
|
ResolverInfo — A ResolverInfo object for owner .
|
ArgumentError — owner cannot be null (ArgumentError).
|
getURLRequest | () | method |
public function getURLRequest(item:*):URLRequest
Returns a URLRequest object for an item.
If item
is null
, null
is returned. If item
is a URLRequest,
item
is returned. For all other types, this method returns a new URLRequest object with a url
parameter created by invoking resolveFilename()
with item
.
Parameters
item:* — Expression identifying the item to generate a URLRequest object for.
|
URLRequest — A URLRequest object for item .
|
See also
load | () | method |
public function load(item:*, loader:*, owner:* = null, context:* = null):void
Begins loading content into an object.
Normally, the owner
and resolver
properties of the LoaderEx
, SoundEx
,
and URLLoaderEx
properties are read-only after creation. Using this method (instead of the object's load()
or loadAsset()
methods) allows those properties to be changed without creating a new instance of the object.
Make sure that the object specified by the loader
parameter is not active. Unexpected results can occur
if the object's owner
property is changed while the object is loading data.
Parameters
item:* — A reference to the content to load. The routine uses the getURLRequest() method, passing in item , to determine the actual content to load.
| |
loader:* — The object to load content into. loader can be one of the following types:
Other object types passed in as the | |
owner:* (default = null ) — The new owner of the object. If owner is null , the object's current owner
property is set to null .
| |
context:* (default = null ) — An optional SoundLoaderContext or LoaderContext object to pass to the loader object's load() method.
|
See also
registerOwner | () | method |
public function registerOwner(owner:*):ResolverInfo
Registers an object as an owner with this resolver.
Registering an owner allows developers to collect aggregate information and extended events for content objects that have a specific owner associated with them.
Parameters
owner:* — The owner to register.
|
ResolverInfo — A ResolverInfo object for owner .
|
ArgumentError — owner cannot be null (ArgumentError).
|
resolveFilename | () | method |
public function resolveFilename(item:*):String
Returns a fully qualified URI for an item.
If item
is null
, the empty string ("") is returned. If item
is the empty string ("") or item
is an object that, when cast to a String, resolves to the empty string, then the path
property value is returned.
Parameters
item:* — Expression identifying the item to get the fully qualified URI of. item can be one of
the following types:
|
String — The fully qualified URI for item .
|
unregisterOwner | () | method |
public function unregisterOwner(owner:*):void
Unregisters an object as an owner with this resolver.
If you maintain a reference to the ResolverInfo object for an unregistered owner, note that the ResolverInfo will not be updated with new aggregate statistics, nor will it dispatch any events.
Parameters
owner:* — The owner to unregister.
|
IllegalOperationError — cannot unregister owner while transaction is active (IllegalOperationError).
|