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

What is Framer? Join the Community
Return to index
Nic von Dort
Posted Jul 20 - Read on Facebook

Please. How to add different actions dependable of the times clicked?

psd.btnyes.on Events.Click, (event, layer) ->
if psd.btnyes.onClick = 1
psd.gkv.states.switch("stateA")
psd.bu.states.switch("stateA")
psd.phv.states.switch("stateA")
psd.hr.states.switch("stateA")
psd.r.states.switch("stateA")
psd.un.states.switch("stateA")
if psd.btnyes.onClick = 2

psd.phv.states.switch("stateB")
psd.hr.states.switch("stateB")
psd.r.states.switch("stateB")
psd.un.states.switch("stateB")

This doesnt work.... :/

6 Comments

Eelco Lempsink

Hi Nic, you can set up a counter outside of your click handler and then increase it each click: http://share.framerjs.com/ivf999yj9a3s/

Rob Byrd

I would create an object outside of the click event and incriment it by 1 on click events
myObj = {counter:0}
element.on Event.click, ->
--myObj.counter ++
--if myObj.counter == 1
---- logic here
--if myObj.counter == 2
----logic here

Nic von Dort

Great!!! Thank you guys

Dezideriu Sorin Raita

myObj = {counter:0}
element.on Event.click, ->
--myObj.counter ++
--if myObj.counter == 1
---- logic here
--if myObj.counter == 2
----logic here

Dezideriu Sorin Raita

try it

Dezideriu Sorin Raita

it might helps

Read the entire post on Facebook