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

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

I'm having trouble understanding how nesting works in Framer. I imported a sketch file and created a new layer in Framer after doing so. When trying to nest the new layer (framerLayer1) under (sketchLayer1) I get the error.

I tried doing so like this...framerLayer1 = new Layer
framerLayer1.parent = sketchLayer1

"TypeError: sketchLayer1 is not a function. (In 'sketchLayer1', 'sketchLayer1' is an instance of Layer)"

How do I fix this?

6 Comments

Jonas Treub

You'll have to target the layer from Sketch using the import variable. If that variable is named sketch it looks like this:

sketch.sketchLayer1

Dimitri Campbell

I used Utils.globalLayers(sketch) though.

Jonas Treub

Can you share an example. Its hard to debug without context ;)

Dimitri Campbell
Dimitri Campbell

The goal is to move the header layer to the front and nest box2Click, box2Image, and box2Framer under box2 from Sketch so it can scroll with the rest of the scrollbox. Sorry about the name changes, I cleaned it up.

Jonas Treub

Layers created in code are ordered by creation. The latest created is the most front. The header layer you want in front is part of the Game_List. Another layer is animated and positioned on top. Thereby hiding the header. The easiest solution is to extract the header from the hierarchy and place it on top. Be sure to add the following line at the end of your code lines.

header.parent = null

If you add it before creating some other layers, like box2Click, those layers will again be in front of the header.

Read the entire post on Facebook