Hey Muzak, thanks for yr response, I'm not sure of the syntax to use
Delegate in this instance, I tried this:
currSound.onSoundComplete = function() {
trace("mp3c:"+mp3C+"  length:"+snds_ar.length)
//if there are more sound objects to play iterate thru array and retrigger
play()
if (mp3C<snds_ar.length) {
mp3Count++;
//this bit isn't working!
Delegate.create(this, play); //  play();
} else {
if (loopForever) {
mp3Count = 0;
this.play();
} else {
//all sound objects have played and play() is not retriggered
mp3Count = 0;
}
}
 };


but it won't work and I can't find an event to tie this to. If you could
spell it out for me I would be very grateful.
Thanks!,
Dan

On 15/08/07, Muzak <[EMAIL PROTECTED]> wrote:
>
> get rid of the nested function and use Delegate.
>
> regards,
> Muzak
>
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <flashcoders@chattyfig.figleaf.com>
> Sent: Wednesday, August 15, 2007 12:45 PM
> Subject: [Flashcoders] Class to loop sound objects in order
>
>
> > Hi there, thanks for checking my post. I am trying to create a class
> that will play a number of mp3 loops each a specified number
> > of times and in the specified order. I have tried to find an existing
> class but cant find one anywhere.
> >
> > My solution (which may not be that efficient), is to create all of the
> sound objects in the fla then load the mp3s into them. When
> > they are all loaded each sound object is added to a new object that
> holds it as well as a 'loops' property that says how many
> > times the sound object must play. These objects are then put into an
> array in the order they are to be heard. This array is passed
> > to my LoopSound class that controls the playback. I can also pass a
> 'loopForever' property that will make the series repeat
> > indefinitely.
> >
> > The problem I am having is re-triggering the play() function from within
> my LoopSound Class to move onto the next sound in the
> > array. I am sure that there will be a much neater way of achieving what
> I want, and maybe even a pre-written class!
> >
> > Any direction / suggestions / encouragement much appreciated :)
> >
> > Thanks!
> > Danny
>
>
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to