AudioController Class

Class org.rapo.games.AudioController

Inheritance > AudioController

A general purpose audio controller. Provides an easy way manage sounds in an application.
Constructor Summary
  
 AudioController(container:MovieClip)
Creates an AudioController instance with a new MovieClip to contain all GameSound instances.
Property Summary
 MovieClip 
The MovieClip containing the AudioController's GameSound instances
 MovieClip 
The MovieClip (timeline) on which the AudioController's soundClip is created.
 Object 
A property list containing reference to the AudioController's GameSound instances.
Method Summary
 GameSound 
 loadSound(sound_id:String, sound_url:String, is_streaming:Boolean, play_when_loaded:Boolean)
Used to create instances of sounds that are loaded dynamically via loadSound()
 Void 
 onID3Detected(sound_id:String)
Called when an mp3 ID3 tag isdetected in an mp3 sound file.
 Void 
 onSoundLoaded(sound_id:String)
Called when a new sound is loaded.
 Void 
 playSound(sound_id:String, loop:Boolean)
Plays the sound specified by sound_id.
 Void 
 registerSound(sound_id:String)
Used to create instances of sounds that are in the FLA's library via attachSound()
 Void 
 setSoundVolume(sound_id:String, volume:Number)
Sets the volume for the specified sound.
 Void 
 stopSoundAtEndOfLoop(sound_id:String)
Stops the sound specified by sound_id at the end of the current loop.
 Void 
 stopSoundNow(sound_id:String)
Stops the sound specified by sound_id - immediately.
Constructor Detail
AudioController
public function AudioController(container:MovieClip)
Creates an AudioController instance with a new MovieClip to contain all GameSound instances.
Parameters:
container
The MovieClip (timeline) on which the AudioController's soundClip is created.
Property Detail
soundClip
var soundClip:MovieClip;
The MovieClip containing the AudioController's GameSound instances
soundClipContainer
var soundClipContainer:MovieClip;
The MovieClip (timeline) on which the AudioController's soundClip is created.
soundList
var soundList:Object;
A property list containing reference to the AudioController's GameSound instances.
Method Detail
loadSound
public function loadSound(sound_id:String, sound_url:String, is_streaming:Boolean, play_when_loaded:Boolean):GameSound
Used to create instances of sounds that are loaded dynamically via loadSound()
Parameters:
sound_id
Used by the AudioController to identify the sound
sound_url
The URL for the dynamically loaded sound
is_streaming
Indicates whether or not the sound should be streamed.
play_when_loaded
Indicates whether or not the sound should be played immediately when it is loaded.
onID3Detected
public function onID3Detected(sound_id:String):Void
Called when an mp3 ID3 tag isdetected in an mp3 sound file. Not fully implemented.
Parameters:
sound_id
Used by the AudioController to identify the sound
onSoundLoaded
public function onSoundLoaded(sound_id:String):Void
Called when a new sound is loaded.
Parameters:
sound_id
Used by the AudioController to identify the sound
playSound
public function playSound(sound_id:String, loop:Boolean):Void
Plays the sound specified by sound_id.
Parameters:
sound_id
Used by the AudioController to identify the sound
loop
Indicates whether or not the sound should be looped.
registerSound
public function registerSound(sound_id:String):Void
Used to create instances of sounds that are in the FLA's library via attachSound()
Parameters:
sound_id
the Linkage name of the Library sound. Also used by the AudioController to identify the sound
setSoundVolume
public function setSoundVolume(sound_id:String, volume:Number):Void
Sets the volume for the specified sound.
Parameters:
sound_id
Used by the AudioController to identify the sound
volume
The volume that the sound should be set to (0 - 100)
stopSoundAtEndOfLoop
public function stopSoundAtEndOfLoop(sound_id:String):Void
Stops the sound specified by sound_id at the end of the current loop.
Parameters:
sound_id
Used by the AudioController to identify the sound
stopSoundNow
public function stopSoundNow(sound_id:String):Void
Stops the sound specified by sound_id - immediately.
Parameters:
sound_id
Used by the AudioController to identify the sound



Documentation generated by BLDoc Community Edition from B-Line Express.