doh ! :)

I don't know what's wrong with my brain these days, it's working in strange ways ....

of course use onSoundComplete ! I actually had another problem in mind ...

sorry 'bout that !

A

Tobias Fendel [Die ActionScripter] wrote:

hi,

imho a better solution is to use the sound.onSoundComplete event:

mySound.onSoundComplete = function() { loopCount++ }

it is fired next frame after the sound ends. if you start your sound using a
script like mySound.start(0,9999) it may be your sound restarts (and resets
sound.position) before the next frame events calls your check.


greetings
tobias

ps: sorry about my bad english :)

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alain Rousseau
Sent: Thursday, November 17, 2005 7:17 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] onLoop event for sound


Hi Mark,

you could monitor the position of the sound comparred to it's duration, that way you know when it arrives at the end of the sound.

   if (sound.position == sound.duration) {
       loopCount++;
   }

In this case, the loop count will be made at the end of the sound.

HTH

Alain

Mark Walters wrote:


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to