Package | impression.resolver |
Class | public class URLLoaderEx |
Inheritance | URLLoaderEx ![]() |
See also
Property | Defined By | ||
---|---|---|---|
active : Boolean [read-only]
true if the object is currently loading data. | URLLoaderEx | ||
kbps : Number [read-only]
The bitrate at which the object is loading data. | URLLoaderEx | ||
lastAsset : AssetData [read-only] | URLLoaderEx | ||
lastEvent : Event [read-only]
A copy of the most recent event object dispatched by the base class. | URLLoaderEx | ||
lastRequest : URLRequest [read-only] | URLLoaderEx | ||
latency : Number [read-only]
The number of milliseconds between the time that the load request was issued and loading begins. | URLLoaderEx | ||
owner : * [read-only]
The owner of the object. | URLLoaderEx | ||
resolver : AssetResolver [read-only]
The AssetResolver associated with the object. | URLLoaderEx |
Method | Defined By | ||
---|---|---|---|
URLLoaderEx(request:URLRequest = null, owner:* = null, resolver:AssetResolver = null)
Creates a new instance of the URLLoaderEx class. | URLLoaderEx | ||
close():void [override]
Closes the load operation in progress. | URLLoaderEx | ||
load(request:URLRequest):void [override]
Sends and loads data from the specified URL. | URLLoaderEx | ||
Begins loading an asset. | URLLoaderEx |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when the object receives a request to begin loading data. | URLLoaderEx | |||
Dispatched when a load operation in progress is cancelled. | URLLoaderEx | |||
Dispatched when the object has finished loading data. | URLLoaderEx |
active | property |
active:Boolean
[read-only]
true
if the object is currently loading data.
public function get active():Boolean
kbps | property |
kbps:Number
[read-only] The bitrate at which the object is loading data.
This value is calculated by dividing bytesLoaded
by elapsedTime
and adjusting by
a fixed factor to account for TCP/IP overhead.
public function get kbps():Number
lastAsset | property |
lastEvent | property |
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.
public function get lastEvent():Event
lastRequest | property |
lastRequest:URLRequest
[read-only] public function get lastRequest():URLRequest
latency | property |
latency:Number
[read-only] The number of milliseconds between the time that the load request was issued and loading begins.
public function get latency():Number
owner | property |
owner:*
[read-only] The owner of the object.
public function get owner():*
resolver | property |
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
.
public function get resolver():AssetResolver
See also
URLLoaderEx | () | Constructor |
public function URLLoaderEx(request:URLRequest = null, owner:* = null, resolver:AssetResolver = null)
Creates a new instance of the URLLoaderEx class.
If request
parameter is not null
, the load
method will be invoked
with the request
parameter once the object has been instanciated.
request:URLRequest (default = null ) — The object to load.
| |
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.
|
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.
Unlike the URLLoader
class, if no current URL is being loaded, no error is thrown.
load | () | method |
override public function load(request:URLRequest):void
Sends and loads data from the specified URL.
The URLLoaderEx class overrides the default behavior of the URLLoader object in the following manner:
kbps
value is reset.active
property value is false
, it is set to true
and the
ResolverEvent.BEGIN
event is dispatched with the request
parameter as the event's
relatedObject
member.request
parameter is saved as the lastRequest
, and the URLLoader's load
method is invoked.load
method, or the request
parameter is null
, the ResolverEvent.END
event is dispatched with the request
parameter as the event's relatedObject
member.request
parameter is not null
, the error is thrown.Parameters
request:URLRequest — The URLRequest to load.
|
Error — [the error that occured] (Error).
|
See also
loadAsset | () | method |
public function loadAsset(asset:AssetData):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.
|
IllegalOperationError cannot — load asset without resolver (IllegalOperationError).
|
See also
begin | Event |
impression.events.ResolverEvent
impression.events.ResolverEvent.BEGIN
Dispatched when the object receives a request to begin loading data.
This event is dispatched when the load
method is
invoked, either explicitly or implicitly as the result of calling the
loadAsset
method. This event will occur even if the request
is null
or cannot be loaded. This event will not occur if
the active
property value is true
.
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The object that raised the event. |
relatedObject | The object associated with the event.
If target is a LoaderEx , SoundEx , or URLLoaderEx object, relatedObject is the instance of the URLRequest object to load.
If target is a LoaderInfo object, relatedObject is the content object that originally dispatched the ResolverEvent.BEGIN event.
|
See also
close | Event |
flash.events.Event
flash.events.Event.CLOSE
Dispatched when a load operation in progress is cancelled.
This event is dispatched when the object is actively loading and the
the close
method is invoked.
See also
end | Event |
impression.events.ResolverEvent
impression.events.ResolverEvent.END
Dispatched when the object has finished loading data.
This event is dispatched when the object is no longer actively loading
data. This may be due to normal load completion, when an error occurs, or
by invoking the close
method.
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The object that raised the event. |
relatedObject | The object associated with the event.
If target is a LoaderEx , SoundEx , or URLLoaderEx object, relatedObject is the instance of the URLRequest object to load.
If target is a LoaderInfo object, relatedObject is the content object that originally dispatched the ResolverEvent.BEGIN event.
|
See also