States - animation

Hi again.
I have a grid with 3 different images that i made 3 different states for with alpha settings to 100% over each state and vice vera for the other 2 if the state is not current for the specific image,

state1
image 1 = 100%
image 2 = 0%
image 3 = 0%

state2
image 1 = 0%
image 2 = 100%
image 3 = 0%

state3
image 1 = 0%
image 2 = 0%
image 3 = 100%

I´m not sure how to make my state group react to my global variable that I want to change those states with.

when i change the value of my variable I want it to shift state. variable can be from 0-2
(0= state1 or 1=state2 or 2=state3)

how do I do this.

regards ./ mandel