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

What is Framer? Join the Community
Return to index
John Lee
Posted Mar 03 - Read on Facebook

How to do trigger the same set of states but with two different buttons? I don't want to copy and paste the same thing, but need something like an OR statement or function... but ain't figured it out yet

buttonA.onClick ->
(about another ten different states)

buttonB.onClick ->
(about another ten different states)


Jonas Treub

You could create those buttons inside a function, or create a Button class.

John Lee

Thanks, as always Jonas Treub
Would it be something like this:

buttonArray = [x, y] #create a loop for all button

#make the function to call layer and state
changestates = (layerToChange, state) ->
__for button in buttonArray
____button.onClick ->

#the event to trigger the change
otherButton.onclick ->
__changeStates(x, out)
__changeStates(y, out)

If i do it the above way, if I tap button X, to change the first state, then after the state changes, tap button Y, would it still work?

Thanks for your help - and on behalf of my dog, family and friends - THANK YOU!

Read the entire post on Facebook