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

What is Framer? Join the Community
Return to index
Anders Tolborg
Posted Jun 26 - Read on Facebook

How do you deal with Framer adding 1,3,4 etc to layers imported from Sketch (if they have the same name)? In my case I have a list of similar elements, where I want to target the same sublayer for each element. I have tried to loop through them, but the keys do not match the added number.

Example: http://share.framerjs.com/m2n1773oxr49/
How do I target all the buttons?

5 Comments

Luis Escobar

Joshua Crowley this is pretty awesome, but I'm guessing it doesn't work anymore. Do you know of anything comparable?

Brian Williams

You cant have variables with the same name in the same scope. As framer is a psuedo state machine it will still draw them but the reference to the object will be updated to the last one you assign to it.

So for example.

a = new layer
x: 12

a = new layer
x: 24

a.x == 24

Brian Williams

that said, cant you just use the parent layers children collection?

Anders Tolborg

Brian. What do mean when you write "children collection" ? From the parent(s) I try to use .childrenWithName, but the problem is that the children have different names child, child1, child2 etc.

Read the entire post on Facebook