Deselecting the "non" currentTarget

Hey All,

I’m messing around with some code, and I have it set up so that when you click on a square, the alpha goes to .5. I’m trying to set it up so that if you click another square, that alpha goes to .5 and the other square go back to alpha 1.

This is what i have so far:


var sq:Square

for (var a:Number = 0; a < 3; a++) {
    
    sq = new Square()
    addChild(sq);
    sq.x = a * (sq.width + 10)
    sq.addEventListener(MouseEvent.CLICK, sqClick)
    sq.buttonMode = true;
}

function sqClick (e:MouseEvent) {
    
    var mc = e.currentTarget
    mc.alpha = .5
    
}