Why does manually pressing a button multiple times give a different result than pressing a button once and then putting the button code in a loop? See specifics below:
Specifically, I have a button that when pressed calls a method that generates a random number and then displays the appropriate dice image.
I want the dice to have a spinning effect, so I put the code in a loop (say 100 times) with the expectation that the dice image will update 100 times (giving my spinning effect).
However this does not work. Only the final iteration (100th) updates the dice image. No matter how many iterations I use (100, 1,000, 10,000) it only displays the final one, so it’s not updating too quickly.
BUT…if i manually push the button many times then I get my spinning effect.
I feel like some sort of display update is occurring when the roll button method finishes, but I don’t know what exactly is happening.
Does anyone understand my problem and can you tell me what I need to do to cause my dice image to update correctly???
Thank you - Ed