# Removing Listeners That Only Exist on Child

**URL:** <https://forum.kirupa.com/t/removing-listeners-that-only-exist-on-child/327871>\
**Category:** flash\
**Created:** [April 2, 2012, 10:27pm UTC](https://forum.kirupa.com/t/removing-listeners-that-only-exist-on-child/327871 "2012-04-02T22:27:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanDaMan](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@DanDaMan](https://forum.kirupa.com/u/DanDaMan)\
**Post date:** [April 2, 2012, 10:27pm UTC](https://forum.kirupa.com/t/removing-listeners-that-only-exist-on-child/327871/1 "2012-04-02T22:27:46Z")

</div>

I am trying to have a single parent class that a wide variety of classes can extend. Each of them has the exact same event listeners and remove function so I thought I would try to write the function a single time in the parent class.

Parent Class:

```auto

public function removeMe():void {
     /* REMOVE EVENT LISTENERS */
}

```

Child Class:

```auto

public class Child extends Parent {
	public function Child() {
		addEventListener(Event.ADDED_TO_STAGE, beginClass);
	}
	private function beginClass(e:Event):void {
		addEventListener(Event.ENTER_FRAME, eFrame);
		addEventListener(MouseEvent.CLICK, clicked);
	}
	private function eFrame(e:Event):void {
		/* DO STUFF */
	}
	private function clicked(e:MouseEvent):void {
		/* DO MORE STUFF */
	}
}

```

The event listeners are not defined in the parent class and, therefore, I cannot remove them through normal means. Is there any easy way to remove these listeners through the parent class or at least make them known to the parent class?
