# Remove MouseEvent?

**URL:** <https://forum.kirupa.com/t/remove-mouseevent/262422>\
**Category:** Uncategorized\
**Created:** [June 5, 2008, 7:35pm UTC](https://forum.kirupa.com/t/remove-mouseevent/262422 "2008-06-05T19:35:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![asthyanax](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@asthyanax](https://forum.kirupa.com/u/asthyanax)\
**Post date:** [June 5, 2008, 7:35pm UTC](https://forum.kirupa.com/t/remove-mouseevent/262422/1 "2008-06-05T19:35:09Z")

</div>

hi,  
I have a AS3 problem and i’m pretty lost on that probably easy stuff.  
I have a mc that serves as a button:

```php

myButton.addEventListener(MouseEvent.CLICK,click);

```

Then i just want to “kill” that mouseEvent…i have no clue. I tried removeEventListener but it seems not to work. Any idea ?  
Thank’s in advance.

---

<div class="post-metadata">

**Author:** ![Dom\_1](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@Dom\_1](https://forum.kirupa.com/u/Dom_1)\
**Post date:** [June 5, 2008, 7:38pm UTC](https://forum.kirupa.com/t/remove-mouseevent/262422/2 "2008-06-05T19:38:06Z")

</div>

myButton.removeEventListener(MouseEvent.CLICK,click); should work, i’m pretty much 100% about that, if not, maybe try passing it a weakReference to true (the last param) :

myButton.removeEventListener(MouseEvent.CLICK,click, false, 0, true);

---

<div class="post-metadata">

**Author:** ![Felixz](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@Felixz](https://forum.kirupa.com/u/Felixz)\
**Post date:** [June 6, 2008, 1:25pm UTC](https://forum.kirupa.com/t/remove-mouseevent/262422/3 "2008-06-06T13:25:32Z")

</div>

```auto
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.

```

The problem may be in referencing button itself.  
Externally:

```auto
myButton.removeEventListener(MouseEvent.CLICK,click);  

```

Internally:

```auto
event.currentTarget.removeEventListener(MouseEvent.CLICK,click);  

```
