Select and Deselect Images

I am trying to figure out the code to select an image (starts out blue once clicked it may go to green) if clicked again it reverts back to blue. how do I do this with actionscript, would this be accomplished with if statements