|
-
M.D.
[AS3] fix for SoundComplete?
anyone know of a fix for the dreaded Event.SOUND_COMPLETE in AS3?
looping a sound seamlessly will not work with this event.
the only other way I could see is using a timer or enterFrame, and figuring out the change in position over the sounds duration, and using that to play the sound again, something like:
var magicNumber = ?
var seamlessEnd = sound.duration - magicNumber;
timer.delay = seamlessEnd;
-
FK founder & general loiterer
If you are just looping the one loop then why not use the yourMusicTrack.play(0,999, null) to play it 999 times.
SOUND_COMPLETE sucks
-
M.D.
yeah, guess thats the only thing to do.
-
Senior Member
I have used it for years without problems. Of course I always pick music that has pause in the end.
-
Senior Member
this has always made me sad, being both a coder and a composer of loop based music, I have always dreamed of creating aiMuse style interactive score kind of thingy for flash, allowing parts to come in and out as actions change on screen...but alas with out a seamless onComplete it's impossible.
Chris Error
-
Senior Member
Although I've not pushed this into AS3 yet, in earlier versions I actually did my own checks on how far thru the sound clip I was. By doing this I was able to dynamically load the next part seamlessly, or replay the current clip.
Can't imagine I'll go back to using the sound complete check now.
-
Sounds like you are just looking for a way to loop one file. Why would you need on sound complete anyway?
Or maybe I'm off?
-
var magicNumber = ?
var seamlessEnd = sound.duration - magicNumber;
timer.delay = seamlessEnd;
I tried something like this - using the setTimeout function, and finding the 'magic nunmber' by trial and error. I couldn't just loop it as some are suggesting here, as I was trying to join two separate tracks together. It worked, although I wasn't confident that the magic number on my PC would be exactly the same for everyone. Never really found out before I gave up and used a different method altogether.
Would be very useful to know of a solution to this though.
-
M.D.
 Originally Posted by MikeMD
Sounds like you are just looking for a way to loop one file. Why would you need on sound complete anyway?
Or maybe I'm off?
yeah, Flashkit was right, using the loop parameter works. I had forgot all about it.
It still is a problem though for multiple tracks/sounds as chris pointed out.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|