SoundAS
SoundAS copied to clipboard
Destroy of SoundInstance fails after soundCompleted
I do this:
_scenarioSounds.play("audioStart").soundCompleted.addOnce(startSoundComplete);
and in the next function I try to tidy up and release the memory used by the sound:
private function startSoundComplete(si:SoundInstance):void { trace("startSound complete"); si.soundCompleted.removeAll();
//cleanup methods I tried.
//1: _scenarioSounds.removeSound(si.type);
//2: si.destroy();
}
Both fail, I presume because of the last line in the destroy function:
fade.end(false);
Since fade is already null this won't work like it's supposed to.