December 19, 2022, 3:44pm
Hello, my students are working on a quotes feature. When the quote button is clicked, an alert shows up with one of the quotes in the list. The issue is the alert message always shows up as empty at first and then it shows a random quote after the second click.
I have tried solutions such as adding a 0.1 second delaying, setting the alert messages before showing them, adding a message to the invisible component but nothing has worked yet.
December 19, 2022, 4:37pm
What’s happening is that the alert message completes its function before the set/random function is called.
The “then do” section of a function always runs
after the function is completed.
So you need to assign a variable’s value to the randomizer first and then call the alert function to display the variable.
The order of your blocks should be:
Set variable to random message
Set alert message to variable
And actually, you don’t technically need a variable here. You can simply just move the green block above the purple one.
December 19, 2022, 4:53pm
That solution worked, thank you! Oddly enough when I tried it earlier it wasn’t working, maybe it was the mobile app’s response time to the changes in the blocks.
December 19, 2022, 5:26pm
Yes, Thunkable Live can cache a project and not display the current version. It’s unnerving and the cause of much wasted time for me.
I haven’t yet found a reliable way to determine if I’m seeing the current project version except for making an obvious change like altering a label’s text.
@conroy33 is there something you all do in-house to verify that a live test on Thunkable Live is not cached?
March 19, 2023, 5:26pm
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.