# Click button to cycle through sounds

**URL:** https://community.thunkable.com/t/click-button-to-cycle-through-sounds/2061182
**Category:** Questions about Thunkable X
**Created:** [September 28, 2022, 8:38am UTC](https://community.thunkable.com/t/click-button-to-cycle-through-sounds/2061182 "2022-09-28T08:38:16Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![darren.rolfe78ib](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/darren.rolfe78ib/32/140016_2.png) [@darren.rolfe78ib](https://community.thunkable.com/u/darren.rolfe78ib)
#### Post date: [September 28, 2022, 8:38am UTC](https://community.thunkable.com/t/click-button-to-cycle-through-sounds/2061182/1 "2022-09-28T08:38:16Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)
#### Post date: [September 28, 2022, 10:29am UTC](https://community.thunkable.com/t/click-button-to-cycle-through-sounds/2061182/2 "2022-09-28T10:29:49Z")

</div>

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.

 ![screen](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/a/2abf80b4162c4d4746853cc17c5ab5d227fb0649.png)  
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.

---

<div class="post-metadata">

### Author: ![darren.rolfe78ib](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/darren.rolfe78ib/32/140016_2.png) [@darren.rolfe78ib](https://community.thunkable.com/u/darren.rolfe78ib)
#### Post date: [September 28, 2022, 10:58am UTC](https://community.thunkable.com/t/click-button-to-cycle-through-sounds/2061182/3 "2022-09-28T10:58:05Z")

</div>

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…?

---

<div class="post-metadata">

### Author: ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)
#### Post date: [September 28, 2022, 11:04am UTC](https://community.thunkable.com/t/click-button-to-cycle-through-sounds/2061182/4 "2022-09-28T11:04:42Z")

</div>

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 ☺

---

<div class="post-metadata">

### Author: ![darren.rolfe78ib](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/darren.rolfe78ib/32/140016_2.png) [@darren.rolfe78ib](https://community.thunkable.com/u/darren.rolfe78ib)
#### Post date: [September 28, 2022, 11:43am UTC](https://community.thunkable.com/t/click-button-to-cycle-through-sounds/2061182/5 "2022-09-28T11:43:40Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)
#### Post date: [September 28, 2022, 12:14pm UTC](https://community.thunkable.com/t/click-button-to-cycle-through-sounds/2061182/6 "2022-09-28T12:14:17Z")

</div>

> [@darren.rolfe78ib](#):
>
> I need the app tp stop completely after the last click.

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 🙂

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)
#### Post date: [December 27, 2022, 12:14pm UTC](https://community.thunkable.com/t/click-button-to-cycle-through-sounds/2061182/7 "2022-12-27T12:14:31Z")

</div>

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