# Removing a listener

**URL:** <https://forum.kirupa.com/t/removing-a-listener/312595>\
**Category:** flash\
**Created:** [August 8, 2010, 1:46pm UTC](https://forum.kirupa.com/t/removing-a-listener/312595 "2010-08-08T13:46:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kekekiko](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kekekiko](https://forum.kirupa.com/u/kekekiko)\
**Post date:** [August 8, 2010, 1:46pm UTC](https://forum.kirupa.com/t/removing-a-listener/312595/1 "2010-08-08T13:46:28Z")

</div>

I have this code on the first frame of a movieclip:

function onCreditChanged(eventObject:Object)  
{  
if (eventObject.newCredit \>= 250) {  
\_root.footy.gotoAndStop(“2”);  
}else{  
\_root.footy.gotoAndStop(“1”);  
}  
}  
\_root.addEventListener(“CREDIT\_CHANGED”, onCreditChanged);

When going to frame 2 I want to stop the listener but can’t seem to manage it. It won’t ever stop!

How would I remove the event listener in this situation?

thanks
