SoundAS - API Documentation | All Packages | All Classes | Index | Frames | ![]() |
SoundManager | Properties | Methods | |
Package | treefortress.sound |
Class | public class SoundManager |
Inheritance | SoundManager ![]() |
Property | Defined By | ||
---|---|---|---|
groups : Vector.<SoundManager> | SoundManager | ||
loadCompleted : Signal
Dispatched when an external Sound has completed loading. | SoundManager | ||
loadFailed : Signal
Dispatched when an external Sound has failed loading. | SoundManager | ||
masterVolume : Number
Set master volume, which will me multiplied on top of all existing volume levels. | SoundManager | ||
mute : Boolean
Mute all instances. | SoundManager | ||
volume : Number
Set volume on all instances
| SoundManager |
Property | Defined By | ||
---|---|---|---|
activeTweens : Vector.<SoundTween> | SoundManager | ||
groupsByName : Object | SoundManager | ||
instances : Vector.<SoundInstance> | SoundManager | ||
instancesBySound : Dictionary | SoundManager | ||
instancesByType : Object | SoundManager | ||
_masterTween : SoundTween | SoundManager | ||
_masterVolume : Number | SoundManager | ||
_mute : Boolean | SoundManager | ||
_tickEnabled : Boolean | SoundManager | ||
tickEnabled : Boolean | SoundManager | ||
ticker : Sprite | SoundManager | ||
_volume : Number | SoundManager |
Method | Defined By | ||
---|---|---|---|
SoundManager | |||
addMasterTween(startVolume:Number, endVolume:Number, duration:Number = 1000):void | SoundManager | ||
addSound(type:String, sound:Sound):void
Inject a sound that has already been loaded. | SoundManager | ||
addTween(type:String, startVolume:Number, endVolume:Number, duration:Number):SoundTween | SoundManager | ||
fadeAllFrom(startVolume:Number = 0, endVolume:Number = 1, duration:Number = 1000):void
Fade all sounds specifying both the StartVolume and EndVolume. | SoundManager | ||
fadeAllTo(endVolume:Number = 1, duration:Number = 1000):void
Fade all sounds starting from their current Volume
| SoundManager | ||
fadeFrom(type:String, startVolume:Number = 0, endVolume:Number = 1, duration:Number = 1000):SoundInstance
Fade specific sound specifying both the StartVolume and EndVolume. | SoundManager | ||
fadeMasterFrom(startVolume:Number = 0, endVolume:Number = 1, duration:Number = 1000):void
Fade master volume specifying both the StartVolume and EndVolume. | SoundManager | ||
fadeMasterTo(endVolume:Number = 1, duration:Number = 1000):void
Fade master volume starting at the current value
| SoundManager | ||
fadeTo(type:String, endVolume:Number = 1, duration:Number = 1000):SoundInstance
Fade specific sound starting at the current volume
| SoundManager | ||
getSound(type:String, forceNew:Boolean = false):SoundInstance
Returns a SoundInstance for a specific type. | SoundManager | ||
group(name:String):SoundManager
Return a specific group , create one if it doesn't exist. | SoundManager | ||
loadSound(url:String, type:String, buffer:int = 100):void
Preload a sound from a URL or Local Path
| SoundManager | ||
pause(type:String):SoundInstance
Pause a specific sound
| SoundManager | ||
pauseAll():void
Pause all sounds
| SoundManager | ||
play(type:String, volume:Number = 1, startTime:Number = 0, loops:int = 0, allowMultiple:Boolean = false, allowInterrupt:Boolean = true, enableSeamlessLoops:Boolean = false):SoundInstance
Play audio by type. | SoundManager | ||
playFx(type:String, volume:Number = 1, startTime:Number = 0, loops:int = 0):SoundInstance
Convenience function to play a sound that can have overlapping instances (ie click or soundFx). | SoundManager | ||
playLoop(type:String, volume:Number = 1, startTime:Number = 0, enableSeamlessLoops:Boolean = true):SoundInstance
Convenience function to play a sound that should loop forever. | SoundManager | ||
removeAll():void
Unload all Sound instances. | SoundManager | ||
removeSound(type:String):void
Remove a sound from memory. | SoundManager | ||
resume(type:String):SoundInstance
Resume specific sound
| SoundManager | ||
resumeAll():void
Resume all paused instances. | SoundManager | ||
stopAll():void
Stop all sounds immediately. | SoundManager |
Method | Defined By | ||
---|---|---|---|
addInstance(si:SoundInstance):void | SoundManager | ||
init():void
PRIVATE
| SoundManager | ||
onSoundLoadComplete(event:Event):void | SoundManager | ||
onSoundLoadError(event:IOErrorEvent):void | SoundManager | ||
onSoundLoadProgress(event:ProgressEvent):void | SoundManager | ||
onTick(event:Event):void | SoundManager |
_masterTween | property |
protected var _masterTween:SoundTween
_masterVolume | property |
protected var _masterVolume:Number
_mute | property |
protected var _mute:Boolean
_tickEnabled | property |
protected var _tickEnabled:Boolean
_volume | property |
protected var _volume:Number
activeTweens | property |
protected var activeTweens:Vector.<SoundTween>
groups | property |
public var groups:Vector.<SoundManager>
groupsByName | property |
protected var groupsByName:Object
instances | property |
protected var instances:Vector.<SoundInstance>
instancesBySound | property |
protected var instancesBySound:Dictionary
instancesByType | property |
protected var instancesByType:Object
loadCompleted | property |
public var loadCompleted:Signal
Dispatched when an external Sound has completed loading.
loadFailed | property |
public var loadFailed:Signal
Dispatched when an external Sound has failed loading.
masterVolume | property |
masterVolume:Number
Set master volume, which will me multiplied on top of all existing volume levels.
public function get masterVolume():Number
public function set masterVolume(value:Number):void
mute | property |
mute:Boolean
Mute all instances.
public function get mute():Boolean
public function set mute(value:Boolean):void
tickEnabled | property |
tickEnabled:Boolean
protected function get tickEnabled():Boolean
protected function set tickEnabled(value:Boolean):void
ticker | property |
protected var ticker:Sprite
volume | property |
volume:Number
Set volume on all instances
public function get volume():Number
public function set volume(value:Number):void
SoundManager | () | Constructor |
public function SoundManager()
addInstance | () | method |
addMasterTween | () | method |
public function addMasterTween(startVolume:Number, endVolume:Number, duration:Number = 1000):void
Parameters
startVolume:Number | |
endVolume:Number | |
duration:Number (default = 1000 )
|
addSound | () | method |
public function addSound(type:String, sound:Sound):void
Inject a sound that has already been loaded.
Parameters
type:String | |
sound:Sound |
addTween | () | method |
public function addTween(type:String, startVolume:Number, endVolume:Number, duration:Number):SoundTween
Parameters
type:String | |
startVolume:Number | |
endVolume:Number | |
duration:Number |
SoundTween |
fadeAllFrom | () | method |
public function fadeAllFrom(startVolume:Number = 0, endVolume:Number = 1, duration:Number = 1000):void
Fade all sounds specifying both the StartVolume and EndVolume.
Parameters
startVolume:Number (default = 0 )
| |
endVolume:Number (default = 1 )
| |
duration:Number (default = 1000 )
|
fadeAllTo | () | method |
public function fadeAllTo(endVolume:Number = 1, duration:Number = 1000):void
Fade all sounds starting from their current Volume
Parameters
endVolume:Number (default = 1 )
| |
duration:Number (default = 1000 )
|
fadeFrom | () | method |
public function fadeFrom(type:String, startVolume:Number = 0, endVolume:Number = 1, duration:Number = 1000):SoundInstance
Fade specific sound specifying both the StartVolume and EndVolume.
Parameters
type:String | |
startVolume:Number (default = 0 )
| |
endVolume:Number (default = 1 )
| |
duration:Number (default = 1000 )
|
SoundInstance |
fadeMasterFrom | () | method |
public function fadeMasterFrom(startVolume:Number = 0, endVolume:Number = 1, duration:Number = 1000):void
Fade master volume specifying both the StartVolume and EndVolume.
Parameters
startVolume:Number (default = 0 )
| |
endVolume:Number (default = 1 )
| |
duration:Number (default = 1000 )
|
fadeMasterTo | () | method |
public function fadeMasterTo(endVolume:Number = 1, duration:Number = 1000):void
Fade master volume starting at the current value
Parameters
endVolume:Number (default = 1 )
| |
duration:Number (default = 1000 )
|
fadeTo | () | method |
public function fadeTo(type:String, endVolume:Number = 1, duration:Number = 1000):SoundInstance
Fade specific sound starting at the current volume
Parameters
type:String | |
endVolume:Number (default = 1 )
| |
duration:Number (default = 1000 )
|
SoundInstance |
getSound | () | method |
public function getSound(type:String, forceNew:Boolean = false):SoundInstance
Returns a SoundInstance for a specific type.
Parameters
type:String | |
forceNew:Boolean (default = false )
|
SoundInstance |
group | () | method |
public function group(name:String):SoundManager
Return a specific group , create one if it doesn't exist.
Parameters
name:String |
SoundManager |
init | () | method |
protected function init():void
PRIVATE
loadSound | () | method |
public function loadSound(url:String, type:String, buffer:int = 100):void
Preload a sound from a URL or Local Path
Parameters
url:String — External file path to the sound instance.
| |
type:String | |
buffer:int (default = 100 )
|
onSoundLoadComplete | () | method |
protected function onSoundLoadComplete(event:Event):void
Parameters
event:Event |
onSoundLoadError | () | method |
protected function onSoundLoadError(event:IOErrorEvent):void
Parameters
event:IOErrorEvent |
onSoundLoadProgress | () | method |
protected function onSoundLoadProgress(event:ProgressEvent):void
Parameters
event:ProgressEvent |
onTick | () | method |
protected function onTick(event:Event):void
Parameters
event:Event |
pause | () | method |
public function pause(type:String):SoundInstance
Pause a specific sound
Parameters
type:String |
SoundInstance |
pauseAll | () | method |
public function pauseAll():void
Pause all sounds
play | () | method |
public function play(type:String, volume:Number = 1, startTime:Number = 0, loops:int = 0, allowMultiple:Boolean = false, allowInterrupt:Boolean = true, enableSeamlessLoops:Boolean = false):SoundInstance
Play audio by type. It must already be loaded into memory using the addSound() or loadSound() APIs.
Parameters
type:String | |
volume:Number (default = 1 )
| |
startTime:Number (default = 0 ) — Starting time in milliseconds
| |
loops:int (default = 0 ) — Number of times to loop audio, pass -1 to loop forever.
| |
allowMultiple:Boolean (default = false ) — Allow multiple, overlapping instances of this Sound (useful for SoundFX)
| |
allowInterrupt:Boolean (default = true ) — If this sound is currently playing, interrupt it and start at the specified StartTime. Otherwise, just update the Volume.
| |
enableSeamlessLoops:Boolean (default = false )
|
SoundInstance |
playFx | () | method |
public function playFx(type:String, volume:Number = 1, startTime:Number = 0, loops:int = 0):SoundInstance
Convenience function to play a sound that can have overlapping instances (ie click or soundFx).
Parameters
type:String | |
volume:Number (default = 1 )
| |
startTime:Number (default = 0 )
| |
loops:int (default = 0 )
|
SoundInstance |
playLoop | () | method |
public function playLoop(type:String, volume:Number = 1, startTime:Number = 0, enableSeamlessLoops:Boolean = true):SoundInstance
Convenience function to play a sound that should loop forever.
Parameters
type:String | |
volume:Number (default = 1 )
| |
startTime:Number (default = 0 )
| |
enableSeamlessLoops:Boolean (default = true )
|
SoundInstance |
removeAll | () | method |
public function removeAll():void
Unload all Sound instances.
removeSound | () | method |
public function removeSound(type:String):void
Remove a sound from memory.
Parameters
type:String |
resume | () | method |
public function resume(type:String):SoundInstance
Resume specific sound
Parameters
type:String |
SoundInstance |
resumeAll | () | method |
public function resumeAll():void
Resume all paused instances.
stopAll | () | method |
public function stopAll():void
Stop all sounds immediately.