Packageimpression.resolver
Classpublic class LoaderEx
InheritanceLoaderEx Inheritance flash.display.Loader

The LoaderEx class extends the Loader object to support notifications for cancelled operations, general-purpose status events, and object connections for the AssetResolver.

See also

flash.display.Loader


Public Properties
 PropertyDefined By
  contentLoaderInfoEx : LoaderInfoEx
[read-only] The LoaderInfoEx object associated with this object.
LoaderEx
  lastAsset : AssetData
[read-only]
LoaderEx
  lastEvent : Event
[read-only] A copy of the most recent event object dispatched by the base class.
LoaderEx
  lastRequest : URLRequest
[read-only]
LoaderEx
  owner : *
[read-only] The owner of the object.
LoaderEx
  resolver : AssetResolver
[read-only] The AssetResolver associated with the object.
LoaderEx
Public Methods
 MethodDefined By
  
LoaderEx(owner:* = null, resolver:AssetResolver = null)
Creates a new instance of the LoaderEx class.
LoaderEx
  
close():void
[override] Closes the load operation in progress.
LoaderEx
  
load(request:URLRequest, context:LoaderContext = null):void
[override] Loads a SWF, JPEG, progressive JPEG, unanimated GIF, or PNG file into an object that is a child of this LoaderEx object.
LoaderEx
  
loadAsset(asset:AssetData, context:LoaderContext = null):void
Begins loading an asset.
LoaderEx
Property Detail
contentLoaderInfoExproperty
contentLoaderInfoEx:LoaderInfoEx  [read-only]

The LoaderInfoEx object associated with this object. The LoaderInfoEx extends the LoaderInfo object and provides additional information and events.


Implementation
    public function get contentLoaderInfoEx():LoaderInfoEx

See also

lastAssetproperty 
lastAsset:AssetData  [read-only]


Implementation
    public function get lastAsset():AssetData
lastEventproperty 
lastEvent:Event  [read-only]

A copy of the most recent event object dispatched by the base class.

Note that the last event does not include the ResolverEvent.BEGIN or ResolverEvent.END events. The lastEvent object is not reset when the load method is invoked.


Implementation
    public function get lastEvent():Event
lastRequestproperty 
lastRequest:URLRequest  [read-only]


Implementation
    public function get lastRequest():URLRequest
ownerproperty 
owner:*  [read-only]

The owner of the object.


Implementation
    public function get owner():*
resolverproperty 
resolver:AssetResolver  [read-only]

The AssetResolver associated with the object.

The resolver is used to retrieve the fully-qualified URI when the loadAsset method is invoked. The object also reports state change event information to the resolver during the load cycle; allowing for aggregate information to be retrieved from either the resolver and/or the ResolverInfo object for this object's owner.


Implementation
    public function get resolver():AssetResolver

See also

Constructor Detail
LoaderEx()Constructor
public function LoaderEx(owner:* = null, resolver:AssetResolver = null)

Creates a new instance of the LoaderEx class.

Parameters
owner:* (default = null) — The object that the state information for this object should be reported to.
 
resolver:AssetResolver (default = null) — The AssetResolver to associate with this object.
Method Detail
close()method
override public function close():void

Closes the load operation in progress.

Any load operation in progress is immediately terminated. If a load operation was in progress, then the Event.CLOSE event is dispatched by the LoaderInfoEx object associated with this instance.

Unlike the Loader class, if no current URL is being loaded, no error is thrown.

load()method 
override public function load(request:URLRequest, context:LoaderContext = null):void

Loads a SWF, JPEG, progressive JPEG, unanimated GIF, or PNG file into an object that is a child of this LoaderEx object.

The LoaderEx class overrides the default behavior of the Loader object in the following manner:

  1. The kbps value is reset.
  2. If the active property value is false, it is set to true and the ResolverEvent.BEGIN event is dispatched by the LoaderInfoEx object associated with this instance. The event passes the request parameter as the event's relatedObject member.
  3. The request parameter is saved as the lastRequest, and the Loader's load method is invoked.
  4. If an error occured as a result of invoking the base class' load method, or the request parameter is null, the ResolverEvent.END event is dispatched with the request parameter as the event's relatedObject member.
  5. If an error occured, and the request parameter is not null, the error is thrown.

Parameters

request:URLRequest — The URLRequest to load.
 
context:LoaderContext (default = null) — An optional LoaderContext object, which has properties that define the following:
  • Whether or not to check for the existence of a policy file upon loading the object
  • The ApplicationDomain for the loaded object
  • The SecurityDomain for the loaded object
  • The ImageDecodingPolicy for the loaded image object


Throws
Error — [the error that occured] (Error).

See also

begin
end
flash.net.Loader.load()
loadAsset()method 
public function loadAsset(asset:AssetData, context:LoaderContext = null):void

Begins loading an asset.

This method invokes the resolver property's getURLRequest with the asset parameter, then invokes its own load method with the returned request.

Parameters

asset:AssetData — The asset to load.
 
context:LoaderContext (default = null) — An optional LoaderContext object, which has properties that define the following:
  • Whether or not to check for the existence of a policy file upon loading the object
  • The ApplicationDomain for the loaded object
  • The SecurityDomain for the loaded object
  • The ImageDecodingPolicy for the loaded image object


Throws
IllegalOperationError cannot — load asset without resolver (IllegalOperationError).

See also