# addEventListener error ?!

**URL:** <https://forum.kirupa.com/t/addeventlistener-error/318749>\
**Category:** flash\
**Created:** [January 28, 2011, 11:04pm UTC](https://forum.kirupa.com/t/addeventlistener-error/318749 "2011-01-28T23:04:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![samiflashflash](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@samiflashflash](https://forum.kirupa.com/u/samiflashflash)\
**Post date:** [January 28, 2011, 11:04pm UTC](https://forum.kirupa.com/t/addeventlistener-error/318749/1 "2011-01-28T23:04:49Z")

</div>

NVM I FIXED IT !

Im making a cooking game and basically I have my buttons and background export to the stage, which is good, but now I want to make it so when you click on the mustard it exports the mustard movieclip to the stage.

For some reason I am getting an error that does not make any sence to me.

Error 1061: Call to a possibly undefined method addEventListener through a reference with static type Class.

Here is my code:

```auto
package
{
 import flash.display.SimpleButton;
 import flash.events.MouseEvent;
 
 public class mustBttn extends SimpleButton 
 {
  public function mustBttn()
  {
   x = 177 ;
   y = 204.35 ;
 
   mustBttn.addEventListener(MouseEvent.CLICK,gomust)
  }
   public function gomust (e:MouseEvent):void
  {
   trace("yay")
  }
 }
}

```
