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

What is Framer? Join the Community
Return to index
Rahul Dhyawala
Posted Dec 29 - Read on Facebook

How do you set an attribute to a Framer Layer so you can reference that layer later on based on attribute
Ex- layerA.name = "10"
layerB.name = "20"
layerC.name = "50"

Now i want to reference the layer that has name, let say 20.

4 Comments

Benjamin Den Boer

Hey Rahul Dhyawala, you could store the layers you wish to target by name in an array, loop over it and then target them by the name attribute instead of by variable.

Rahul Dhyawala

i know this.. but i have lots of layers.. more than 100. Then it doesn't seem optimal way. Can't I directly reference like getlayerByName or something?

Seoh Char

`Framer.CurrentContext.getLayers` could help you

Rahul Dhyawala

Thanks Benjamin and Seoh

Read the entire post on Facebook