I have a sound/sound channel being set up in my actionscript and
playing as expected, however the sound_complete event is not firing in
all cases. I am attaching an event listener for this event after the
play call, yet the associated handler is not called every time when an
mp3 file reaches the end. There seems to be no pattern as to when it
does/doesn't fire as expected. Code is fairly simple as follows
(SoundAsset is a class that wraps a Sound object with several other
associated variables, soundHandle returns the Sound object):
public function setupSound(inSound:SoundAsset):void {
soundAsset = inSound;
if(!inSound.soundHandle.isBuffering) {
playingSound = inSound.soundHandle;
playingSound.play(0);
playingSound.addEventListener(Event.SOUND_COMPLETE,
soundCompleteHandler);.....
private function soundCompleteHandler(event:Event):void {
trace("I hit the sc handler");.....
As I said, the mp3 file finishes playing but sometimes the
sound_complete does not fire. Anyone ever come across a similar
situation, or can offer any suggestions as to incorrectly set up code?
TIA,
--Mark