# Trying to destroy object of event-target via Event object

**URL:** <https://forum.kirupa.com/t/trying-to-destroy-object-of-event-target-via-event-object/292600>\
**Category:** Uncategorized\
**Created:** [July 16, 2009, 8:18am UTC](https://forum.kirupa.com/t/trying-to-destroy-object-of-event-target-via-event-object/292600 "2009-07-16T08:18:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohbeewan](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ohbeewan/32/1745_2.png) [@ohbeewan](https://forum.kirupa.com/u/ohbeewan)\
**Post date:** [July 16, 2009, 8:18am UTC](https://forum.kirupa.com/t/trying-to-destroy-object-of-event-target-via-event-object/292600/1 "2009-07-16T08:18:13Z")

</div>

Hey ho,

I’m using an Event.COMPLETE dispatch to get notice that a particular object has finished doing its business and can therefore be destroyed, but the target of the event (the object I want to destroy) is read-only via the Event object…anyway around this?

i.e: I’m trying to do this:

```auto

private function _onComplete(e:Event)
{
    // destroy object //
    e.target.removeEventListener(Event.COMPLETE, _onComplete);
    e.target = null;
}

```

…but of course, I get a compiler error: 1059: Property is read-only.

Any idears? Thanks!
