Impression AS3 BCF Documentation | All Packages | All Classes | Index | Frames | ![]() |
SoundEx | Properties | Methods | Events | |
Package | impression.resolver |
Class | public class SoundEx |
Inheritance | SoundEx ![]() |
See also
Property | Defined By | ||
---|---|---|---|
active : Boolean [read-only]
true if the object is currently loading data. | SoundEx | ||
kbps : Number [read-only]
The bitrate at which the object is loading data. | SoundEx | ||
lastAsset : AssetData [read-only] | SoundEx | ||
lastEvent : Event [read-only]
A copy of the most recent event object dispatched by the base class. | SoundEx | ||
lastRequest : URLRequest [read-only] | SoundEx | ||
latency : Number [read-only]
The number of milliseconds between the time that the load request was issued and loading begins. | SoundEx | ||
owner : * [read-only]
The owner of the object. | SoundEx | ||
resolver : AssetResolver [read-only]
The AssetResolver associated with the object. | SoundEx |
Method | Defined By | ||
---|---|---|---|
SoundEx(stream:URLRequest = null, context:SoundLoaderContext = null, owner:* = null, resolver:AssetResolver = null)
Creates a new instance of the SoundEx class. | SoundEx | ||
close():void [override]
Closes the stream, causing any download of data to cease. | SoundEx | ||
load(stream:URLRequest, context:SoundLoaderContext = null):void [override]
Initiates loading of an external MP3 file from the specified URL. | SoundEx | ||
Begins loading an asset. | SoundEx |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when the object receives a request to begin loading data. | SoundEx | |||
Dispatched when a load operation in progress is cancelled. | SoundEx | |||
Dispatched when the object has finished loading data. | SoundEx |
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
SoundEx | () | Constructor |
public function SoundEx(stream:URLRequest = null, context:SoundLoaderContext = null, owner:* = null, resolver:AssetResolver = null)
Creates a new instance of the SoundEx class.
If stream
parameter is not null
, the load
method will be invoked
with the stream
parameter once the object has been instanciated.
stream:URLRequest (default = null ) — The object to load.
| |
context:SoundLoaderContext (default = null ) — An optional SoundLoader context object, which can define the buffer time (the minimum number of
milliseconds of MP3 data to hold in the Sound object's buffer) and can specify whether the application should check
for a cross-domain policy file prior to loading the sound.
| |
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 stream, causing any download of data to cease.
Any load operation in progress is immediately terminated. If a load operation was in progress, then
the Event.CLOSE
event is dispatched.
Unlike the Sound
class, if the stream could not be closed, or the stream was
not open, no error is thrown.
load | () | method |
override public function load(stream:URLRequest, context:SoundLoaderContext = null):void
Initiates loading of an external MP3 file from the specified URL.
The SoundEx class overrides the default behavior of the Sound 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 stream
parameter as the event's
relatedObject
member.stream
parameter is saved as the lastRequest
, and the Sound's load
method is invoked.load
method, or the stream
parameter is null
, the ResolverEvent.END
event is dispatched with the stream
parameter as the event's relatedObject
member.stream
parameter is not null
, the error is thrown.Parameters
stream:URLRequest — The URLRequest to load.
| |
context:SoundLoaderContext (default = null ) — An optional SoundLoader context object, which can define the buffer time (the minimum number of
milliseconds of MP3 data to hold in the Sound object's buffer) and can specify whether the application should check
for a cross-domain policy file prior to loading the sound.
|
Error — [the error that occured] (Error).
|
See also
loadAsset | () | method |
public function loadAsset(asset:AssetData, context:SoundLoaderContext = 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:SoundLoaderContext (default = null ) — An optional SoundLoader context object, which can define the buffer time (the minimum number of
milliseconds of MP3 data to hold in the Sound object's buffer) and can specify whether the application should check
for a cross-domain policy file prior to loading the sound.
|
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