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

What is Framer? Join the Community
Return to index
Kyle Sollenberger
Posted Sep 24 - Read on Facebook

Is there a way to get the x property of a layer during an animation?

13 Comments

Benjamin Den Boer

Are you looking for the x values it interpolates between?
If not, to get the start and end values, you could write this:

layer.on Events.AnimationStart, ->
print layer.x

layer.on Events.AnimationEnd, ->
print layer.x

Kyle Sollenberger

Looking for the values in between.

Seoh Char

layer.on 'change:x', (x) ->
print x

did you find it?

Johannes Eckert

wait, what is that what Cha Seoh just put there? Can you call event listeners on properties? Is this new or somewhere documented? That's huge!

Kyle Sollenberger

whoa. Cha. is that actually a thing!?

Koen Bok

Yep you can, but it was undocumented because I wanted to test it a bit. I'll add it to the docs soon.

Johannes Eckert

well, I was off framer for just two weeks and I will want to read through the whole documentation again once this is all released :-)

Kyle Sollenberger

Koen Here's what i've got, but it doesn't seem to be working for me. any help would be appreciated

Kyle Sollenberger

temp = new Layer
x: @count.html.to_i

temp.animate
properties:
x: @data.count[index]

temp.on 'change:x', (x) ->
el.count.html = x
console.dir(x)

Koen Bok

Kyle, the change event currently doesn't get thrown during animations. Will be fixed in the next update.

Kyle Sollenberger

ah, got it. thanks. not to push, but is there an eta for the next update? just trying to plan ahead.

Koen Bok

Depends on some other bugs and how hard they are to solve but should be a matter of days not weeks.

Kyle Sollenberger

awesome.

Read the entire post on Facebook