I am working on a simple audio player that plays mp3 files inside a
playlist. I am trying to create a continuous music play, once mp3 file
after the next. However I am unable to capture the
"Event.SOUND_COMPLETE" event. Here is how the code is structured.

I have a player class(player.as - does not extend anything) that has a
play function, that does a bunch of things including creating a
SoundFacade object(Standard class found in programming AS3 book) and
calling its play method. In the SoundFacade class extends
EvenDispatcher, it sets up various events and triggers for the sound
object (i.e. ProgressEvent.PROGRESS, Event.COMPLETE, Event.OPEN) which
get triggered appropriately. However, I would like to know in the
player class when the ProgressEvent, or Sound_complete event is
triggered. I know they get triggered in the SoundFacade object, but
how do i capture and use them in the player class.

Sharing some relevant parts of SoundFacade class:

>>public class SoundFacade extends EventDispatcher
>>>this.s.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
>>>this.s.addEventListener(Event.SOUND_COMPLETE,onPlayComplete);

>>>public function onLoadProgress(event:ProgressEvent):void
>>>{   
>>>     this.dispatchEvent(event);
>>>}
The debugger gets to this progressHandler

Sharing some relevant parts of player class:

>>public class player
>>>var SFObject:SoundFacade;

>>>public function progressHandler(event:ProgressEvent):void 
>>>{
>>>     this.dispatchEvent(event);
>>>}

The debugger never gets to this progressHandler

Any help on this would be appreciated.

--Vik

Reply via email to