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

What is Framer? Join the Community
Return to index
Marco Paglia
Posted Oct 16 - Read on Facebook

Hi frameristas,
Let's say:
- I create a LayerA
- I create a textlayerA and I make it superLayer:LayerA
- I create a copy of LayerA, such as LayerB=LayerA.copy().

Is there a way to access the copied version of the textlayer that is now children of LayerB? By access I mean changing its properties, such as its text.

Thank you
m

7 Comments

Dami Dina
German Bauer

I think you should be able to get to it with:
LayerB.childrenWithName("textlayerA")

Peter Ng

Hrmmmm don't know much about copy but depending on what you want to do you can extend the layer class with your own class that way you can store multiple layers in one object. And then you can push those objects to an array where you can reference them. Any more specifics you can give in what u exactly wanna do?

Marco Paglia

Hi folks and thank you for your replies. I know I could have done an array, but I'm trying to use copy for this particular instance. German Bauer when I do LayerB.childrenWithName("textlayerA"), I can't change its properties, can I? It seems to be read only? Here's the example: http://share.framerjs.com/ixe6tvngb9f8/. Peter Ng what I'm trying to do is to generate new speech bubbles and change the text inside.

Specifically I'm using copy() in my projects because there's a function that spits out a new speech bubble any time something happens, and these speech bubbles can be an infinite number... maybe there could be a different approach?

German Bauer

I would probably make a function that takes the parent element as parameter and a text and generates a speech bubble child layer with the new text filled in, I'm not near my mac to see if there are better approaches

Marco Paglia

German Bauer I agree that's the best approach. I just wondered if there was any way to access a copied child. Seems like there isn't.

Read the entire post on Facebook