Access keys

SoundLoad

Kind of class: class
Inherits from: BytesLoad < RetryableLoad < Load < EventDispatcher < CoreObject
Version: 12/22/06
Author: Aaron Clinger
Classpath: org.casaframework.load.media.sound.SoundLoad
File last modified: Wednesday, 24 January 2007, 21:45:39
Eases the chore of loading mp3s.
Usage note:
This class only works with event sounds and does not support streaming sounds. Event onInstantiate is called once the first loaded byte(s) have been received.
Example:
function onSoundComplete(sender:SoundLoad):Void {
    sender.getSound().start();
}

function onSoundLoading(sender:SoundLoad, bytesLoaded:Number, bytesTotal:Number):Void {
    trace(bytesLoaded + "/" + bytesTotal + " bytes have been loaded into " + sender.getMovieClip());
}

this.createEmptyMovieClip("soundContainer_mc", this.getNextHighestDepth());

var audioClip:SoundLoad = new SoundLoad(this.soundContainer_mc, "audio.mp3");
this.audioClip.addEventObserver(this, SoundLoad.EVENT_LOAD_COMPLETE, "onSoundComplete");
this.audioClip.addEventObserver(this, SoundLoad.EVENT_LOAD_PROGRESS, "onSoundLoading");
this.audioClip.start();

Summary

Constructor
Class properties
Class properties inherited from BytesLoad
Class properties inherited from RetryableLoad
Instance properties
Instance properties inherited from RetryableLoad
Instance properties inherited from Load
Instance properties inherited from EventDispatcher
Instance properties inherited from CoreObject

Constructor

SoundLoad

function SoundLoad (
target_mc:MovieClip, mp3Path:String)
Defines file and location of load triggered by #start.
Parameters:
target_mc:
The MovieClip instance on which the Sound object operates.
mp3Path :
The absolute or relative URL of the MP3 file to be loaded.

Instance methods

destroy

function destroy (
) : Void

getBytesLoaded

function getBytesLoaded (
) : Number

getBytesTotal

function getBytesTotal (
) : Number

getMovieClip

function getMovieClip (
) : MovieClip
Returns:
Returns MovieClip specified as target_mc in SoundLoad.

getSound

function getSound (
) : Sound
Returns:
Returns the sound object SoundLoad class is wrapping and loading.