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

What is Framer? Join the Community
Return to index
Nikolai Prettner
Posted Dec 11 - Read on Facebook

Hey everyone!

I'm trying to create a new layer everytime a user clicks on a button. I've 2 issues with that now.

1. Since everytime a person clicks on the button and a new layer is created within that loop, how can I name it e.g 'Layer 1, Layer 2, Layer 3, etc'. Right now it just names it 'Layer 0' everytime a new one is created.

2. Is there anyway I can set the height of a layer as text for example: 'widthLabel.text = layerA.width'?

2 Comments

Maximilian Bredow

On your second question: have you tried “#{layerA.width}” yet?

Maximilian Bredow

On your first question: How about you generate a counter that increments by 1 each time you click, something like:

counter = counter++
layer.name: “Layer”+ “ “ + counter

Read the entire post on Facebook