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?
Hi Wojtek. You could work around this by creating the layers in a function instead of using copy.
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.
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"