Question about arrays

I would like to make an array of 5 actors, but I am having trouble working out how to do this.
Then I have it so that the first actor is displayed.
I would then like to make it so that every time it is touched it cycles through the images, and then when it reaches the 5th image it goes back to the first.
A global variable will be changed along with the images, which also needs to change value between 1 and 5, then back to 1 and so on
normally I would do something like this
if var = 0 {
currentimage = currentimage + 1
currentimage = currentimage mod 5
image_index=sprite[currentimage]
}
Is something like this possible?
Thanks in advance
Then I have it so that the first actor is displayed.
I would then like to make it so that every time it is touched it cycles through the images, and then when it reaches the 5th image it goes back to the first.
A global variable will be changed along with the images, which also needs to change value between 1 and 5, then back to 1 and so on
normally I would do something like this
if var = 0 {
currentimage = currentimage + 1
currentimage = currentimage mod 5
image_index=sprite[currentimage]
}
Is something like this possible?
Thanks in advance
Comments
make a attribute called currentimage
make a rule when touch is pressed change attribute currentimage to (currentimage+1)%6
thats your modulus right there. everytime its pressed it will add one till it reaches 5, then once its 5 and pressed again it will recycyle back to 0. then just have rules when attribute current image =0 change image to whatever, when current image=1 change image to whatever and ect and keep going up to 5
cheers
Thanks for your help