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

What is Framer? Join the Community
Return to index
Mic Ky
Posted Sep 18 - Read on Facebook

Need Help!!! Dont understand why Button_weiter isn't an object. I've coded a layer with a textlabel as superlayer and need an event (onclick) on these Button.

:(

9 Comments

Alan Travis

could you screen shot your top 10 lines as well please?

Mic Ky

Of course.... here we go

Mic Ky

This is the super layer

Alan Travis

Ahhh... The problem is a code term called Hoisting, which coffeeScript is not doing for us... In other languages this could work because the layer declaration would be pulled UP above the use of that variable...

The solution is to simply define all of your layers before trying to do something with them... In this case you're attempting to add an onClick event to an object that does not exist...

Ex)

Alan Travis

Mic Ky

Ah okay....
but wouldn't it be easier to "design" it?
Here the problem is that the position isnt the same as layouted.... ?

Mic Ky

Mic Ky

Alan Travis

A co-worker of mine is also thinking part of the problem is that the flowComponent is being defined at line 1... One of the rules of flowComponent is "They must always be added after all the layers in your prototype (so that in the code they are last, but in the layer list they are on top)." Taken from https://medium.com/the-school-of-do/framer-cheat-sheet-flow-components-f7ca94632227

Would you mind sharing your project?

Read the entire post on Facebook