//count to 9 loop.
//ngambles on 07/18/2009, 9:39 am Videocopilot.net
You can use the modulus operator (%). It divides the two values and returns the remainder.
Math.floor( time ) % 9
-----------------------------------------------------------------------------------
This will count from zero to eight, resulting in 9 unique numbers that change every second. To get it to count from 1 to 9 just add 1.
Math.floor( time ) % 9 + 1
-----------------------------------------------------------------------------------
To make it change faster multiply time by some number greater than 1.
The code you want is...
Math.floor( time ) % 10