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 |
|---|
| | 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 | Called when an mp3 ID3 tag isdetected in an mp3 sound file. |
| Void | Called when a new sound is loaded. |
| Void | Plays the sound specified by sound_id. |
| Void | Used to create instances of sounds that are in the FLA's library via attachSound() |
| Void | Sets the volume for the specified sound. |
| Void | Stops the sound specified by sound_id at the end of the current loop. |
| Void | Stops the sound specified by sound_id - immediately. |
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.
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.
loadSound
public function loadSound(sound_id:String, sound_url:String, is_streaming:Boolean, play_when_loaded:Boolean):
GameSoundUsed 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.