Making a Delay before textbooks appear in a sequence

29 views
Skip to first unread message

James Shepherd

unread,
Oct 31, 2019, 12:36:01 PM10/31/19
to MIT App Inventor Forum
Hi all,

I am very new to MIT App inventor and have no coding experience. I am trying to learn through doing things of interest, I did a short face to face course but I apologise in advance if this seems basic/obvious. I have searched the forums and found similar things but nothing I was able to make work with my issue. 

Basically on a single screen I'd like to have four text boxes which appear one after the other after a button is clicked by the user  i.e button is pressed: box one appears, 2 seconds later box 2 appears, 2 seconds later box 3 appears and 2 seconds later box 4 appears. I found a way to have a delay between the first and second textbox but whatever I seem to try the third box appears at the same time as the second. 

I've attached the blocks for the delay I did manage to get to work using a clock. IF anyone has any blocks I could look at to help me out, pointers, links or concepts I could do with learning in general to help I'd really appreciate some direction. Currently I'm just stuck. IF any advice could be kept really basic id appreciate it. 

Regards,
James
Screenshot 2019-10-21 at 15.39.30.png
Screenshot 2019-10-21 at 15.39.51.png

TimAI2

unread,
Oct 31, 2019, 2:23:54 PM10/31/19
to MIT App Inventor Forum
Something like this

blocksshowboxes.png


James Shepherd

unread,
Oct 31, 2019, 2:44:16 PM10/31/19
to MIT App Inventor Forum
Thank you TimAI2 I will give it a go!

James Shepherd

unread,
Nov 2, 2019, 8:10:16 AM11/2/19
to MIT App Inventor Forum
it flippin works! thank you! 🙏
Can i ask, to help me understand how this operates; so what im thinking is that the variable called 'counter' is set as 1 (does this mean one second?) and then when the timer is activated if the counter is below 5 (seconds?) it should make visible the items in the list. 
However i don't quite understand where it loops back to display each one individually after a delay. I see it gets the counter again and adds 1, but i guess i thought the part before that would have made all the boxes appear rather than one at a time. 
Obviously it works which is brilliant, I just want to increase my learning, if you could explain it would be really useful, however if this is a fairly basic principle in app inventor that i could google or find in the manual id really appreciate if you could signpost me to the type of term i could search for a tutorial on.

Thanks again!   

TimAI2

unread,
Nov 2, 2019, 8:19:31 AM11/2/19
to MIT App Inventor Forum
As you can see from the blocks, the timer (clock) interval for firing is set to 2000 milliseconds (2 seconds) - this is the delay you wanted between each textbox appearing

The counter ensures that you iterate the timer 4 times, it is not related to the delay. The clock will keep firing every 2 seconds, displaying the next textbox in the list, using the counter value to select the index of the textbox in the list,   until the counter is bigger than 4, then it stops the clock

There are probably hundreds of examples like this (everyone wants to do something slightly different)
I suggest you work through some of the tutorials and other resource materials including the FAQ, or just search this forum.

James Shepherd

unread,
Nov 2, 2019, 8:24:10 AM11/2/19
to MIT App Inventor Forum
Thanks very much for spelling that out for me, I had tried a few tutorials but got stuck on certain terms which derailed progress, but that's pieced a lot together. I'll check out some other tutorials as well. Thanks again
Reply all
Reply to author
Forward
0 new messages