Is the timer time show able in the screen?

Hello All, I have inserted a timer in my project and it is working fine. My timer is set to 6 seconds. I want to show the seconds in the screen as if the user can understand how many seconds ze left. Is it possible?

Thanks
Farhad

Hi,

this is possible but you have to use additional blocks for that because the timer itself is a non-displayed component.

You will need to add a label on screen and you set the text to be empty. Then you will need to create a variable and for example set it to numeric value “6”. Now you use the “timer fires” event. Within that you have to add some kind of “if this then that”.

Now what you want to add within the “if block” is something like

*instead of "change app X by …" you could also use math blocks like app X = app X - 1

Now each time your timer fires the value will decrease and so does your label. Change the timer to one second because you want the blocks to be executed every second (not only every 6 seconds).

Since we don’t want to go below 0 we have to add something in the “else” part:

You might want to add something like

to stop the timer. below that you can also add what else you want to do once the timer comes to “0”.

Hope this is helpful. You can find explanation for most components in the docs.

Best, Chris

3 Likes

Thanks. I will try it.

FYI, we’re currently working on a couple of features that should make this sort of thing much easier!

-Mark

1 Like

Hi,

I am also doing the same. Can you please share your blocks if this worked for you?

@thestrengthinstitute Here is a simple example of a countdown timer (It counts for 6 seconds)
https://x.thunkable.com/copy/c0e86953855aaccc86012f5bf13082fa

2 Likes

@paulmw thanks a ton. This worked.
Here’s my blocks

2 Likes