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

What is Framer? Join the Community
Return to index
Johann Kasuch
Posted Apr 11 - Read on Facebook

Hey frameristas,
I have a (probably basic) scoping issue. How do i refer to a function which is created in a class, outside of the class. i made a little prototype using the doc code.

In my real project i have a rather complex class, with a remote state affecting different layer within the class. i want to access this remotestate by tapping on a different button.


Johann Kasuch


Isa Bison

1. Instead of Button = new Button; would advise button = new Button;
2. On line 30, button.activate()

Isa Bison

As long as you have a reference to an instance, you can call the methods on that instance. (An instance is an object based on a class. A method is a function attached to that instance as defined in the class. In the example I gave, button is an instance of the Button class, and it has the method activate, so we just need to say button.activate() )

Read the entire post on Facebook