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

What is Framer? Join the Community
Return to index
Paul Cotton
Posted Apr 14 - Read on Facebook

Not sure if this is an impossibility or a syntax issue, but how do I group multiple variables under one variable?

I have two layers named card1 and card2.

I want to define:
bothCards = card1, card2

So that I can use: bothCards.states.add in order to apply the same state properties and animations to each of them, without having to write it out twice.
Or bothCards.y, or bothCards.animate etc.


Paul Cotton

Suspect this might be solved by arrays (which I am new to), will go fight with that and see.

Mike Feldstein

you can't do it the way you want but coffeescript lets you do some neat things

Shirley Man

Array is the right way to go. Take a look at the CoffeeScript Intro example (line 42) made by the Framer guys.

Paul Cotton

Thank you everyone, I'm getting there :D

Fran Pérez

Paul Cotton

Legendary. Now I've applied the starting state to the cards as a group, and triggered the return to their original state ( To make it perfect I just need to put a slight delay between them, but either way this works really well and should speed up a lot of stuff in future.

Paul Cotton

My main problem was that I was trying to trigger

from outside the for card in cards statement, when I should have treated it the same way I treat Utils.delay etc

Read the entire post on Facebook