i = setInterval(function(){},100) + 1
while(i--){
clearInterval(i)
}
See that above? Run that at any time during your Flash to completely clear out any intervals you have running. If you're like me, sometimes you have 2-3 running at a time, and switching between frames and inadvertantly resetting your intervals renders some crazy results. When you call this, don't forget about your intervals that are running onMotionComplete. Make sure you stop your tweens at the same time, or they'll keep running and reset your interval. Damnit if that last piece of advice didn't waste an hour of my time!
I'll let Ted explain how it works:
http://ted.onflash.org/2004/11/fun-with-intervals.php
No comments:
Post a Comment