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

What is Framer? Join the Community
Return to index
Stewart Murrie
Posted Nov 16 - Read on Facebook

I'm trying to create states based on the names of other layers, like this:

layer.states["someOtherLayer"] =
x: 50

But I get an odd error: Cannot read property 'value' of undefined.

According to the Framer docs, this should work. And indeed, the example they provide works fine:

for i in [1..3]
layerA.states["state#{i}"] =
y: i * 200

But, if I change that middle line to take out the loop index:

for i in [1..3]
layerA.states["state"] =
y: i * 200

Then the error returns.

Am I misunderstanding something, or is this a bug? (I'm pretty new to Framer & CoffeeScript).


Kim Does

Not a 100% sure, but I think you might be adding an object to the state rather than a string, could that be it? could give you the string instead of the object.

The second example that gives the error is where you're continually overwriting 1 state, because you can't have multiple states with the same name.

Maybe someone else comes along with a bit more insight, but these are things to maybe look into.

Stewart Murrie

Thanks for the reply, Kim! I think actually that there is a bug with how Framer parses the variable name used for naming the states. Do you have a couple of minutes to see if you can replicate it? I published a mockup which shows different ways the error can be made to occur (you'll need to look at the code—the mockup doesn't actually do anything :) )

Stewart Murrie

Yup, confirmed as a bug by Framer. Should be fixed in the next release (v75)

Read the entire post on Facebook