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

What is Framer? Join the Community
Return to index
Michael-Owen Liston
Posted Aug 07 - Read on Facebook

Hello Framers!
New to Framer and the wiles of Coffeescript, so forgive me the obvious question, but I haven’t been able to find documentation elsewhere:

1. The code below compiles, but does not return any value for parent.width

leftCol = new Layer
width: 800
height: 800

for i in [0...3]
layer = new Layer
parent: leftCol
name: "scoreBox" + i
----> width: parent.width / 4
height: 200
x: i * 220
y: 0

2. To get the value of the parent layer in this case, I have to call it by name

leftCol = new Layer
width: 800
height: 500

for i in [0...3]
layer = new Layer
parent: leftCol
name: "scoreBox" + i
----> width: leftCol.width / 4
height: 200
x: i * 220
y: 0

3. Option #2 doesn’t seem very DRY. Is there something about namespaces or something else fundamental that I’m overlooking that’s preventing #1 from working as intended?

2 Comments

Michael-Owen Liston

Thanks, Marc!

Read the entire post on Facebook