I wasn't concerned with performance - I just can't get the iterating variable to work. Instead of giving me a count, it iterates forever. It keepings increasing the value in the variable indefiniately.
The array is holding text data which comes from the state of 6 sprites that are touched by the player. Initially, all array values are 0 but when the player touches the sprite, the number of the sprite replaces the 0. You start out with a display showing 0,0,0,0,0,0 but after you've touched them all it shows 1,2,3,4,5,6.
It's proving difficult to descrive I guess and the code is buried in a decent sized project right now, so I'll try to post a smaller example later if I can reproduce my problem in a capx.