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

What is Framer? Join the Community
Return to index
Jenny Shen
Posted Aug 22 - Read on Facebook

Hey guys, new to Framer here.

Dumb question: If I have a button and the first time I click on it, it displays message 1, and the second time I click on it, it displays message 2, etc. How would I be able to do that? Tried using counters but apparently am not doing it right.

Thanks in advance!

3 Comments

Gilbert Han

text.states =
zero:
text: "zero"
first:
text: "first"
second:
text: "second"
# text.stateSwitch("zero")

button.onClick ->
text.stateCycle()

Jenny Shen

Hey Gilbert, thanks a bunch! However, I think I framed the problem wrong. :(
The messages are actually images, and the first click will show image message 1. The second click will show the second image, while also displaying the first image.

David Plakon

You can use his code above but instead of text: do image: ObjectWithImageYouWant.image

Read the entire post on Facebook