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

What is Framer? Join the Community
Return to index
Mark Kinsey
Posted Dec 14 - Read on Facebook

I'm designing something like this:

ScrollView
-content
--Item_1
---Like_button_1
--Item_2
---Like_button_2
--Item_3
......

What's the cleanest way to listen for events on each Like_button? (all the layers are imported from sketch - *not* generated from data)

I thought maybe I could iterate through Item_, and look for the Like_button sublayer, but it has a different name each time. Could use string matching, which seems sloppy. I guess the only other way would be if you could assign an attribute in sketch using a layer naming convention - e.g. Like_button[like_button], which framer would rename to Like_button_n[like_button], and could be referred to as sketch.Like_button_n or sketch.Item_1.like_button (starts to look like a CSS id/class-like system)

2 Comments

Nitin Sampathi

.children or .childrenWithName?

Mark Kinsey

yep - though framer creates unique names from every layer in a sketch import

Read the entire post on Facebook