# Deselecting the "non" currentTarget

**URL:** <https://forum.kirupa.com/t/deselecting-the-non-currenttarget/290798>\
**Category:** flash\
**Created:** [June 19, 2009, 6:58pm UTC](https://forum.kirupa.com/t/deselecting-the-non-currenttarget/290798 "2009-06-19T18:58:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashdaddy](https://avatars.discourse-cdn.com/v4/letter/f/e36b37/32.png) [@flashdaddy](https://forum.kirupa.com/u/flashdaddy)\
**Post date:** [June 19, 2009, 6:58pm UTC](https://forum.kirupa.com/t/deselecting-the-non-currenttarget/290798/1 "2009-06-19T18:58:10Z")

</div>

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:

```auto

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
    
}

```
