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

What is Framer? Join the Community
Return to index
Sergey Perepelkin
Posted Sep 14 - Read on Facebook

Hello, guys!
I want to use Classes in my work. For example, create Class that includes Navigation Bar and Content Spaсe. All other elements I want to put inside Content Space. But it writes that Content Space is not defined, when I'm trying to use it outside the class (for parenting). Help!
I don't have framer studio so there's link to my example and there's to my coffeescript file


Floris Verloop

Hey Sergey,

This is because your navBar and contentSpace layers are only available in the constructor function of your class. This is a scoping issue.

In order to make the Layers available as a property of your class, assign them to "this". You can do this by adding an "@" to the layer names. You can then access the layers like any property: "CourseSc.contentSpace".

Here's an example:

Sergey Perepelkin

Floris Verloop, It works! Thank you very much!

Read the entire post on Facebook