| Package | vegas.media |
| Class | public class SoundLoader |
| Inheritance | SoundLoader CoreActionLoader CoreAction Task Object |
| Implements | Stoppable |
Example :
import system.process.Action ;
import vegas.media.CoreSound ;
import vegas.media.SoundLoader ;
import flash.net.URLRequest ;
var start:Function = function( action:Action ):void
{
trace( "start" ) ;
}
var progress:Function = function( bytesLoaded:Number , bytesTotal:Number, action:Action ):void
{
trace( "progress loaded:" + bytesLoaded + " total:" + target.bytesTotal) ;
}
var finish:Function = function( action:Action ):void
{
trace( "finish" ) ;
sound.play() ;
}
var url:String = "mp3/test.mp3" ;
var sound:CoreSound = new CoreSound() ;
var process:SoundLoader = new SoundLoader( sound ) ;
process.addEventListener(ActionEvent.START , start ) ;
process.addEventListener(ActionEvent.PROGRESS , progress ) ;
process.addEventListener(ActionEvent.FINISH , finish ) ;
process.request = new URLRequest( url ) ;
process.run() ;
| Property | Defined By | ||
|---|---|---|---|
| bytesLoaded : uint [override] [read-only]
Indicates the number of bytes that have been loaded thus far during the load operation. | SoundLoader | ||
| bytesTotal : uint [override] [read-only]
Indicates the total number of bytes in the downloaded data. | SoundLoader | ||
![]() | cache : Boolean
The cache flag of this resource (default is true). | CoreActionLoader | |
![]() | cacheParameterName : String
The name of the uri query parameter when the cache attribute is true. | CoreActionLoader | |
![]() | changeIt : Signaler
This signal emit when the notifyChanged method is invoked. | CoreAction | |
![]() | clearIt : Signaler
This signal emit when the notifyCleared method is invoked. | CoreAction | |
![]() | complete : Signaler
This signal emit when the notifyComplete method is invoked. | CoreActionLoader | |
| context : SoundLoaderContext
Minimum number of milliseconds of MP3 data to hold in the Sound object's buffer. | SoundLoader | ||
![]() | DEFAULT_CACHE_PARAMETER : String = random [static]
The name of the default cache uri query parameter ("random"). | CoreActionLoader | |
![]() | DEFAULT_DELAY : uint = 8000 [static]
The default value of the delay before the ActionEvent.TIMEOUT event (defines in the constructor of the class). | CoreActionLoader | |
![]() | DEFAULT_TIMEOUT_POLICY : TimeoutPolicy [static]
The default TimeoutPolicy value used to set the timeoutPolicy member of all new objects of this class. | CoreActionLoader | |
![]() | delay : uint [read-only]
Indicates the timeout interval duration. | CoreActionLoader | |
![]() | error : Signaler
This signal emit when the notifyError method is invoked. | CoreActionLoader | |
![]() | finishIt : Signaler
This signal emit when the notifyFinished method is invoked. | Task | |
![]() | httpStatus : Signaler
This signal emit when the notifyHttpStatus method is invoked. | CoreActionLoader | |
| id3 : ID3Info [read-only]
(read-only) Provides access to the metadata that is part of an MP3 file. | SoundLoader | ||
| id3It : Signaler [read-only]
This signal emit when the notifyId3 method is invoked. | SoundLoader | ||
![]() | infoIt : Signaler
This signal emit when the notifyInfo method is invoked. | CoreAction | |
![]() | init : Signaler
This signal emit when the notifyInit method is invoked. | CoreActionLoader | |
| isBuffering : Boolean [read-only]
(read-only) Returns the buffering state of external MP3 files. | SoundLoader | ||
| length : Number [read-only]
(read-only) The length of the current sound in milliseconds. | SoundLoader | ||
| loader : IEventDispatcher [override]
Indicates the loader object of this process. | SoundLoader | ||
![]() | logger : Logger
Determinates the internal Logger reference of this Loggable object. | Task | |
![]() | looping : Boolean
The flag to determinate if the Action object is looped. | CoreAction | |
![]() | loopIt : Signaler
This signal emit when the notifyLooped method is invoked. | CoreAction | |
![]() | open : Signaler
This signal emit when the notifyOpen method is invoked. | CoreActionLoader | |
![]() | pauseIt : Signaler
This signal emit when the notifyPause method is invoked. | CoreAction | |
![]() | phase : String [read-only]
The current phase of the action. | Task | |
| position : Number [read-only]
The current position of the playhead within the sound. | SoundLoader | ||
![]() | progressIt : Signaler
This signal emit when the notifyProgress method is invoked. | CoreAction | |
![]() | request : URLRequest
Indicates the URLRequest object who captures all of the information in a single HTTP request. | CoreActionLoader | |
![]() | resumeIt : Signaler
This signal emit when the notifyResumed method is invoked. | CoreAction | |
![]() | running : Boolean [read-only]
Indicates true if the process is in progress. | Task | |
![]() | startIt : Signaler
This signal emit when the notifyStarted method is invoked. | Task | |
![]() | stopIt : Signaler
This signal emit when the notifyStopped method is invoked. | CoreAction | |
![]() | timeoutIt : Signaler
This signal emit when the notifyTimeOut method is invoked. | CoreAction | |
![]() | timeoutPolicy : TimeoutPolicy
Indicates the timeout policy of the loader. | CoreActionLoader | |
| url : String [read-only]
(read-only) The URL from which this sound was loaded. | SoundLoader | ||
| Method | Defined By | ||
|---|---|---|---|
SoundLoader(sound:CoreSound = null)
Creates a new SoundLoader instance. | SoundLoader | ||
![]() | clone():* [override]
Returns a shallow copy of this object. | CoreActionLoader | |
close():void [override]
Cancels a load() method operation that is currently in progress for the Loader instance. | SoundLoader | ||
![]() | isLocked():Boolean
Returns true if the object is locked. | Task | |
![]() | lock():void
Locks the object. | Task | |
![]() | notifyChanged():void
Notify when the process is changed. | CoreAction | |
![]() | notifyCleared():void
Notify when the process is cleared. | CoreAction | |
![]() | notifyComplete():void
Notify when the process is complete. | CoreActionLoader | |
![]() | notifyError(error:Object = null):void
Notify when the process failed. | CoreActionLoader | |
![]() | notifyFinished():void [override]
Notify an ActionEvent when the process is finished. | CoreActionLoader | |
![]() | notifyHttpStatus(status:Object = null):void
Notify when the loading process httpstatus is changed.. | CoreActionLoader | |
notifyId3():void
Notify when the process is initialize. | SoundLoader | ||
![]() | notifyInfo(info:*):void
Notify a specific information when the process is changed. | CoreAction | |
![]() | notifyInit():void
Notify when the process is initialize. | CoreActionLoader | |
![]() | notifyLooped():void
Notify when the process is looped. | CoreAction | |
![]() | notifyOpen():void
Notify when the process is open. | CoreActionLoader | |
![]() | notifyPaused():void
Notify when the process is paused. | CoreAction | |
![]() | notifyProgress():void
Notify when the process is in progress. | CoreAction | |
![]() | notifyResumed():void
Notify when the process is resumed. | CoreAction | |
![]() | notifyStarted():void [override]
Notify an ActionEvent when the process is started. | CoreActionLoader | |
![]() | notifyStopped():void
Notify when the process is stopped. | CoreAction | |
![]() | notifyTimeOut():void
Notify when the process is out of time. | CoreAction | |
register(dispatcher:IEventDispatcher):void [override]
Register the loader object. | SoundLoader | ||
![]() | run(... arguments):void [override]
Run the process. | CoreActionLoader | |
![]() | setDelay(time:uint, useSeconds:Boolean = false):void
Sets the timeout interval duration. | CoreActionLoader | |
stop():void
Stops the process if is running
| SoundLoader | ||
![]() | unlock():void
Unlocks the display. | Task | |
unregister(dispatcher:IEventDispatcher):void [override]
Unregister the loader object. | SoundLoader | ||
| Method | Defined By | ||
|---|---|---|---|
![]() | _complete(e:Event):void
Invoked when the loading is complete. | CoreActionLoader | |
![]() | _error(e:ErrorEvent):void
Dispatch an ErrorEvent if a call to load() attempts a server problem (IOErrorEvent or SecurityErrorEvent). | CoreActionLoader | |
![]() | _httpStatus(e:HTTPStatusEvent):void
Dispatch HTTPStatusEvent if a call to load() attempts to access data over HTTP and the current Flash Player environment is able to detect and return the status code for the request. | CoreActionLoader | |
_id3(e:Event):void
Invoked when the Event.ID3 event is fired. | SoundLoader | ||
![]() | _init(e:Event):void
Invoked when the loading is init. | CoreActionLoader | |
![]() | _open(e:Event):void
Dispatch Event.OPEN event when the download operation commences following a call to the load() method. | CoreActionLoader | |
![]() | _progress(e:ProgressEvent):void
Invoked when the loading is in complete. | CoreActionLoader | |
_run():void [override]
This protected method contains the invokation of the load method of the current loader of this process. | SoundLoader | ||
![]() | resolveRequest():void
Resolves the request of the loader with the cache query parameter if the cache attribute is true. | CoreActionLoader | |
![]() | setRunning(b:Boolean):void
Changes the running property value. | Task | |
| bytesLoaded | property |
bytesLoaded:uint [read-only] [override] Indicates the number of bytes that have been loaded thus far during the load operation.
public function get bytesLoaded():uint| bytesTotal | property |
bytesTotal:uint [read-only] [override] Indicates the total number of bytes in the downloaded data.
public function get bytesTotal():uint| context | property |
context:SoundLoaderContextMinimum number of milliseconds of MP3 data to hold in the Sound object's buffer. The Sound object waits until it has at least this much data before beginning playback and before resuming playback after a network stall. The default value is 1000 (one second).
public function get context():SoundLoaderContext public function set context(value:SoundLoaderContext):void| id3 | property |
id3:ID3Info [read-only] (read-only) Provides access to the metadata that is part of an MP3 file.
public function get id3():ID3Info| id3It | property |
id3It:Signaler [read-only] This signal emit when the notifyId3 method is invoked.
public function get id3It():Signaler| isBuffering | property |
isBuffering:Boolean [read-only] (read-only) Returns the buffering state of external MP3 files. If the value is true, any playback is currently suspended while the object waits for more data.
public function get isBuffering():Boolean| length | property |
length:Number [read-only] (read-only) The length of the current sound in milliseconds.
public function get length():Number| loader | property |
loader:IEventDispatcher[override] Indicates the loader object of this process.
public function get loader():IEventDispatcher public function set loader(value:IEventDispatcher):void| position | property |
position:Number [read-only] The current position of the playhead within the sound. If the value is NaN, the internal SoundChannel is 'null'.
public function get position():Number| url | property |
url:String [read-only] (read-only) The URL from which this sound was loaded. This property is applicable only to Sound objects that were loaded using the Sound.load() method. For Sound objects that are associated with a sound asset from a SWF's library, the value of the url property is null.
public function get url():String| SoundLoader | () | Constructor |
public function SoundLoader(sound:CoreSound = null)Creates a new SoundLoader instance.
Parameterssound:CoreSound (default = null) — The Sound object to load.
|
| _id3 | () | method |
protected function _id3(e:Event):voidInvoked when the Event.ID3 event is fired.
Parameters
e:Event |
| _run | () | method |
override protected function _run():voidThis protected method contains the invokation of the load method of the current loader of this process.
| close | () | method |
override public function close():voidCancels a load() method operation that is currently in progress for the Loader instance.
| notifyId3 | () | method |
public function notifyId3():voidNotify when the process is initialize.
| register | () | method |
override public function register(dispatcher:IEventDispatcher):voidRegister the loader object.
Parameters
dispatcher:IEventDispatcher |
| stop | () | method |
public function stop():voidStops the process if is running
| unregister | () | method |
override public function unregister(dispatcher:IEventDispatcher):voidUnregister the loader object.
Parameters
dispatcher:IEventDispatcher |