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

What is Framer? Join the Community
Return to index
Rafael Conde
Posted Apr 09 - Read on Facebook

Any idea how can I declare an Event inside a for loop?
For example:

for i in listCells[1..4]
i.onMouseDown (event, layer) ->
i.states.switch("fingerDown", curve: "spring(60, 25, 0)")

The animation will only target the last element of the array.
Here's a quick example file:

3 Comments

George Kedenburg III

In your event use @ instead of i

Rafael Conde

Oh nice, that makes sense. I got why it was overriding the layer, just couldn't remember the fix. That's so much George!

Darin Dimitrov

I had a similar problem recently, hope this is helpful (read the comments). https://www.facebook.com/groups/framerjs/permalink/837120439748362/

Read the entire post on Facebook