Cycling through pieces of text in an array when the mouse is pressed
in
Programming Questions
•
1 year ago
This is a beginner question, and I apologize if it's already been answered elsewhere in the forum. I'm trying to find the best way to access different pieces of text stored in an array. When the user clicks a button, I want the text currently displayed on the screen to be replaced with the text stored in the next array element. I guess what I'm mainly struggling with figuring out how to express is how to get mousePressed() to access these different elements in sequential order. I think this must be a pretty simple thing to do, but I'm having trouble figuring it out just because most of the array examples I can find use "for" loops to access the information contained in the array, rather than show how to cycle through the elements one by one. I think I just need to be pointed in the right direction about how I should approach this. Thanks!
1