# Selected button in AS 3

**URL:** <https://forum.kirupa.com/t/selected-button-in-as-3/274830>\
**Category:** Uncategorized\
**Created:** [November 5, 2008, 3:08pm UTC](https://forum.kirupa.com/t/selected-button-in-as-3/274830 "2008-11-05T15:08:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitras](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nitras/32/1475_2.png) [@nitras](https://forum.kirupa.com/u/nitras)\
**Post date:** [November 5, 2008, 3:08pm UTC](https://forum.kirupa.com/t/selected-button-in-as-3/274830/1 "2008-11-05T15:08:58Z")

</div>

greetings all

hopefully a short question

i have a batch of buttons.

now in the past (as 2) i had this very simple check to see if the button was clicked, meanwhile the other buttons got back to its original state, via this simple code

```auto

var selectedM:MovieClip;
BUTTON.onRelease = function() {
            if (selectedM != this) {
                selectedM.enabled = true;
            }
            //if an item is selected we make sure the item can't be triggered again.                 
            selectedM = this;
            selectedM.enabled = false;

```

now in AS 3. it seems to be a different story

i tried:

```auto

var selectedM:MovieClip;
function clicker(e:Event){
if (selectedM != e.target)
    {
       selectedM.enabled = true;
    }
    
    selectedM = e.target;
    e.target.enabled = false;
}

//for loop has BUTTON.addEventListener(MouseEvent.CLICK,clicker)

```

or where e.target is i tried to replace it with “this” but all to no avail

i am probally looking over something but if anyone could give me a go, i’d be very thankfull

cheers
