As I see, layer.copy() doesn't copy the events the layer has. Do you have any workaround for that? I need to duplicate a group of layers with their events attached to but couldn't do that.
I would do it like this: http://share.framerjs.com/uhl3fx0dsaju/
Hey thanks Ben Rodenhäuser, this would work for some cases but in my case the view group is really complex and it's hard to do that in this way.
Emin, why would it be hard to do this way? You said you need to duplicate a group of layers... Are they already grouped in some logical way? Stored in an array? If not, you can add them to an array, and loop over its contents, applying that function to each layer you're copying.
I guess my next question would be: How are you latching on to them to make copies? Could you not use the same method to also attach the event as Ben's shown?
Chris Camargo, It's a bit long to describe. But when I was writing it, you made me think maybe it can be still managed. So I will experiment on it some first and then let you know, thanks. : )
You can use a custom class that extends Layer, and define the events within the Class: