# Cant Remove Event Listener?

**URL:** <https://forum.kirupa.com/t/cant-remove-event-listener/294512>\
**Category:** Uncategorized\
**Created:** [August 15, 2009, 10:14am UTC](https://forum.kirupa.com/t/cant-remove-event-listener/294512 "2009-08-15T10:14:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![popnfresh24](https://avatars.discourse-cdn.com/v4/letter/p/87869e/32.png) [@popnfresh24](https://forum.kirupa.com/u/popnfresh24)\
**Post date:** [August 15, 2009, 10:14am UTC](https://forum.kirupa.com/t/cant-remove-event-listener/294512/1 "2009-08-15T10:14:15Z")

</div>

Hey… i have an “if” statement that creates an eventlistener… i then have an if statement to remove it… but everytime i have the “removeEventListener” thingy i get an error… and suggestions of why???

```auto
favourites.addEventListener(MouseEvent.CLICK, openfav);
function openfav(event:MouseEvent) {
    fav.play();
    inside.play();
    favshadow.play();
    favourites.nextFrame();
    adobeilink.gotoAndStop(1);
    
    
if (adobeit.text=="full1"){
    testingempty.text="finish"
    adobeilink.play();
stage.addEventListener(Event.ENTER_FRAME, zee);
function zee (event:Event){

if (inside.currentFrame==50){

    adobei.gotoAndStop(70);
    adobei.visible=true;
    adobeilink.visible=false;}
    
    if(adobei.currentFrame==70)
    {adobei.stop();}
    }
    
    }

}

favourites.addEventListener(MouseEvent.MOUSE_UP, mouseyup)
function mouseyup (event:MouseEvent) {
if (testingempty.text=="finish")
{stage.removeEventListener(Event.ENTER_FRAME, zee);}}

```

so when i test the movie i get this error

“1120: Access of undefined property zee.”

refering to the removeEventListener function… i need to remove it because it stuffs up things down the track… and it doesn’t matter where i put it or anything… it still has the problem of finding it… any help???

thanx
