This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Jason Nelson
Posted Jun 30 - Read on Facebook

Hello Framerers!

Looking for some insight on the best way write something that should be relatively simple. Is there a straightforward way to tell when an animation has completed on a one off basis?

Using Events.AnimationEnd creates a listener that lives in perpetuity. Is there a built in way to have this only listen once then go away? Is there a simple way to destroy the listener?

I don't want the listener to fire overtime the object animates, just the first time.

Right now, I hack a Utils.delay event to match animation time, but if the animation is slowed down at all then they fall out of sync.

I've tried Utils.debounce, but again, depending on if the prototype hits any performance issues, I run into unexpected behavior.

Any thoughts or guidance is very appreciated.

TIA!

1 Comments

Jordan Robert Dobson

Yes.

myLayer.once Events.Click, ->

Read the entire post on Facebook