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

What is Framer? Join the Community
Return to index
Wojtek Galaj
Posted Feb 15 - Read on Facebook

Hey guys,

When I Layer.copy() I loose the names of my layer's children and so I can not reference a child layer in the copy to manipulate it later. Is this by design or am I missing something?


Jonas Treub

Hi Wojtek. You could work around this by creating the layers in a function instead of using copy.

Wojtek Galaj

Yeah, that's what I ended up doing. I was just wondering if I was missing something. Knowing it's working as designed, I'll implement my own copy or create them in code. Thanks.

Davo Galavotti

You can use the copySingle function (it will copy the layer element without his events), as follows:

newObject = originalObject.copySingle()
newObject.props =
name: 'myNewNamedObject'

After that you can set new events like this:

myNewNamedObject.onTap ->
print "Hello there"

Read the entire post on Facebook