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

What is Framer? Join the Community
Return to index
Carl Cooper
Posted May 12 - Read on Facebook

Is there a best practice or use case of when you would use an animation object versus just specifying the properties:

For example:

myAnimation = new Animation
layer: myLayer
properties:
y: 100

versus

myLayer.animate
properties:
y: 100

5 Comments

Jonas Treub

You van reuse Animations and start them from multiple places in your code

Johannes Eckert

you can also listen to things like myAnimation.on Events.AnimationEnd to know when it ended

Shirley Man

Is there any reason not to use an animation object then?

Johannes Eckert

If you really just want to move an object and don't care about events on it, then a direct animate is just handy and way shorter

Koen Bok

You also get the explicit animation passed back:

myAnimation = layer.animate(...)

Read the entire post on Facebook