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

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

hey guys!
i need your help. Right now my class looks something like this. But i want to refer to an individual array everytime i create a button. How do i achieve that?

7 Comments

Johann Kasuch

This might explain it a bit more.

Jordan Robert Dobson

How many arrays though?

Jordan Robert Dobson

So you could pass the array in...

Jordan Robert Dobson

Btn = newButton
collection: array1

For setup...

Jordan Robert Dobson

In your constructor...

options.collection?.push @

Douwe Homans

If you want to have an individual array per button you should use an instance variable. (like you have now for @width)

.....
@width = 300
@array = []
.....

You can then do:

button3 = new Button
print button3.array

button4 = new Button
print button4.array

Johann Kasuch

Great! Thanks :)

Read the entire post on Facebook