Changing actor image with each click.

Hello, I'm new to gamesalad. I want to be able to change my actor image each time I click on it, up to three images and it stays on the last image. For example:
image0
Click
image1
click
image2
click...
image2
Thank you for your time.
image0
Click
image1
click
image2
click...
image2
Thank you for your time.
Comments
There are more sophisticated implementations of this on the forums... see below (thanks @mrglockling).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
then in the actor that changes you make 1 rule saying when touch is pressed change attribute "(game.image+1)%4" < %4 changes the attribute # 1-4 repeatedly
Then make 4 more rules saying when attribute = 1 change image and repeat this changing the (1) to whatever number you want. Hope that makes sense
This is not working correctly. I display the text and my imageNumber attribute is working correctly and incrementing when I click, but the image is not displayed.
There is something wrong with this:
Change Attribute: self.Image To:"image".."imageNumber
I also tried
Change Attribute: self.Image To:"image".."self.imageNumber
Thank you Mr. Glockling, your code works once I took out %4 because I did not need to rotate it. But I didn't like how I had to make more rules for it to work. But it got it done.
Make sure your images are named 1, 2, 3, 4, 5 . . . etc . . . .and then simply do this: