Using the "Wait # seconds" block question

This is my first post here and I am just learning Thunkable so please be patient. :slight_smile:

I am creating a simple app for a live in person game (like a mini escape room) where the app is used as a minor piece of the activity. The app will be open on Screen 1. Users enter a code and takes them to a second screen which displays text and an exit button back to the first screen. I set up a timer so that if they don’t hit the exit button, it will automatically return to the main screen after 10 seconds.

Here’s the problem. If they DO press the exit button, the timer still activates. This is causing a problem on the first screen. As they are entering the code on the first screen, if the timer activates in the background it resets the main screen back to the original and the user loses what they have typed.

So, my question is…is there a way to stop the wait timer when screen 1 loads? This way, if they do hit the exit button, the timer will stop?

I can’t set the timer to a shorter amount of time as they might need a few seconds to read all of the information.

I’d like as simplistic solution as I can possibly implement as I need this app ready for testing with actual people in 4 days. If I have to, I will remove the timer but that causes a problem if people forget to hit the exit button so it is a last resort option for me.

Example of stopping a timer.


Place the timer stop block in the button pressing processing unit if you want to stop the timer when the button is pressed.

Thank you for your suggestion which I tried. Here’s an image of the code I added to each screen. The withdrawal screen code (Secondary screen) is still my original code. I added the “timer1 set Enabled to false” to my Screen1.

It is still doing the exact same thing.

I then realized that maybe I can’t stop the “wait # seconds” block so I removed that code and replaced my secondary screen code as follows:

That causes my app to crash when I attempt to load that screen. It closes my app too quickly to click the “show details” option. I don’t know how to do an error report through this program.

Obviously I am using the Timer code incorrectly but I’m not sure what I’ve done wrong.

Edited: I have narrowed it down to this: If I add “When Timer1 Fires”, it crashes. Everything else is fine.

The “set IntervalMilliseconds” block causes a crash on Android, so do not use it. Specify an interval only in the properties panel.

Timer works in two modes. Timer.loops = true - cyclic operation after a specified time interval (after the timer is turned on). Timer.loops = false - one-time operation after a specified time interval (after the timer starts). Instead of the “wait seconds” block, use Timer.loops = false.

That was it! It is now working perfectly. Thank you so much for taking the time to help me!