Click button to cycle through sounds

Hi, new to Thunkable…

I need a button that when clicked, plays “sound 1”

When clicked again, plays “sound 2”
When clicked again, plays “sound 3” etc.

I can make this happen with numerous buttons but cannot see how to get it to work with the same button.

Is this possible?

Thanks.

1 Like

You can have a variable that increases as you push that button, and after pressing button just use a case sentence to choose the sound it will play …
In the next example, pressing button 5th time will repeat the cycle, coming back to sound_1 and this way you can have an infinite cycle.


Didn’t tested to see if you need some wait or something else blocks, as I’m not familiarized with sounds… This is only the general idea.

Thanks, this is really interesting. I’ll have a play with it later on.

Just one more thing, when the last sound in the list is played, I need another click to stop the whole process and return back ready to start again…?

That was your initial request, right ? click - play sound. Playing 1st sound after the last is clicked linked too.
Now, as I told you, I didn’t use sounds until now, so I can’t tell how you handle that - If a playing sound will stop when you click, or needs to finish playing 1st - you need to test it :smiling_face:

1 Like

I need the app tp stop completely after the last click.

Another click will restart from 1 again.

I’m confident in getting the sounds playing so I’ll have a go later and let you know.

Thanks for the advice!

Easy to accomplish that. Just eliminate last else, and put condition to play sound only if variable value is between 1 and 4. Example was for cycle, how you required :slight_smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.