# Remove eventlistener and target

**URL:** <https://forum.kirupa.com/t/remove-eventlistener-and-target/326133>\
**Category:** Uncategorized\
**Created:** [November 24, 2011, 3:26pm UTC](https://forum.kirupa.com/t/remove-eventlistener-and-target/326133 "2011-11-24T15:26:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeancnicolas](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jeancnicolas](https://forum.kirupa.com/u/jeancnicolas)\
**Post date:** [November 24, 2011, 3:26pm UTC](https://forum.kirupa.com/t/remove-eventlistener-and-target/326133/1 "2011-11-24T15:26:56Z")

</div>

straight into the code - mps is a OSMF video instance - when it has finished playing through the TimeEvent - I can remove its listener but not remove it from the stage - why is this not working!?

```auto
mps.addEventListener(TimeEvent.COMPLETE,removeVideo);
function removeVideo(t:TimeEvent):void
{
    t.target.removeEventListener(t.type, arguments.callee);
    removeChild(t.target);
}

```
