Game Development Reference
In-Depth Information
functions follows the form of the
stopSound method; if no specific sound is passed in, the method
runs on all of them.
Note how each of the
setter
public function mute(value:Boolean = false, name:String = null):
void {
if (name) {
if (_soundList[name]) {
_soundList[name].mute(value);
if (!_soundList[name].isMuted) _allMuted
= false;
} else {
throw new Error( " Sound " + name + " does not
exist. " );
}
} else {
_allMuted = value;
for each (var i:SoundEngineObject in _soundList) {
i.mute(_allMuted);
}
}
}
public function pause(value:Boolean = true, name:String = null):void {
if (name) {
if (_soundList[name]) {
_soundList[name].pause(value);
} else {
throw new Error( " Sound " + name + " does not
exist. " );
}
} else {
for (var i:String in _soundList) _soundList[i].
pause(value);
}
}
public function isPlaying(name:String):Boolean {
if (_soundList[name]) {
return _soundList[name].isPlaying;
}
else if (_debug) {
trace(
"
Sound
"
+ name +
"
does not exist.
"
);
}
return false;
}
public function isPaused(name:String):Boolean {
Search Nedrilad ::




Custom Search