Ok, so Im doing a school project, and im almost done but I need to add a parameter and loop.
For the loop I wanted to just make a text/label that changes colors like every second, but I have no idea where to start. I need help
Ok, so Im doing a school project, and im almost done but I need to add a parameter and loop.
For the loop I wanted to just make a text/label that changes colors like every second, but I have no idea where to start. I need help
You need a Clock.Timer event, in the event you can change the color of the TextBox/Label.
Will that still technically count as a loop?
You need a counter, get a color from the list, then set it to the TextColor. then counter = count+1, if counter>length of the colorList, then counter =1
Im a bit of newbie so Im confused on what youre saying here. What color should I get from the list?
since this is your school project, I can not give you the blocks directly.
Textbox.TextColor only accep a color/number, you can not set it to a list.
So you need to pick a item from the color_list.
Or an easy way is to pick a random color from the list.
This school project isn't strict or anything, were allowed to receive help.
But basically youre saying is that I need it to pick a random color from the list, and the it switches between them right?
I am helping you.
you can read this to learn List:
Ok, but just so you know, this is the "loop" were supposed to use
normally yes, but when you talk about 'do something in every second', you will need a Clock.Timer, at least in App Inventor.
MISSION COMPLETE! I managed to come up with this block of code on my own. And It works perfectly. Thank you so much for your help
Actually its caused some bit of lag issues, Ill get it fixed up soon enough
the FOR EACH block is totally useless here.
there is a PICK A RAMDOM ITEM FROM LIST block.
Yea but I need the for each block as its in the requirements, and the for each block tells how many times i can repeat the action, if i woudl want it to repeat a certain amount of times its pretty important
This is why you get these lag issues...
Just remove the for loop... it does not make sense to use it for changing the color of one textbox....you only see the last color anyway...
You have to add a counter variable to stop the clock after n times
Taifun