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

What is Framer? Join the Community
Return to index
Cole Townsend
Posted Sep 17 - Read on Facebook

Is there a way to specify an animation for layerA.on myScale.AnimationEnd? or perhaps Events.myScale.animationEnd?

8 Comments

Jordan Robert Dobson

Like this...

myScale.on Events.AnimationEnd, ->
layerA.animate
curve: "spring(100,30,0)"
properties:
rotation: 180

Rohan K

How do you use .off to switch off the listener on myScale without creating a separate handler function? Just So that layerA does not animate every time animation is applied on myScale.

Jordan Robert Dobson

Instead of .on you could use .once

Jordan Robert Dobson

I've honestly never used .off Joshua Tucker?

Rohan K

Aaaah!! Thank you :)

Joshua Tucker

Jordan Robert Dobson I almost never use off – once is the way to go.

Rohan K You can't use off without a handler function. The function is anonymous when there's no handler, so when you call off on it, it has no reference to original (anonymous) function.

Jordan Robert Dobson

Sure. I can get you an answer for .off I just have to look it up and I'm at lunch.

Rohan K

I was trying to figure out how to queue animations and trigger them in sequence. .off seemed like the only way to do it but requires creating a handler every time. I didn't know about .once but I found a module that lets you specify a timeline for multiple animations.

Read the entire post on Facebook