[SOLVED] I have a function with looped animation. Is there a way to stop function on event?
And it's probably better to get rid of the interval. Instead, create looped animation using animation Events—meaning call the second animation on End of the first one and call first one on End of the second one :)
You can assign your interval to a variable. You'll then be able to call .invalidate() and it should stop the interval.
Edit: I looked it up and removing intervals looks like this:
runLoop = Utils.interval 5, -> //Do Stuff