# Create new object from evt.target

**URL:** https://forum.kirupa.com/t/create-new-object-from-evt-target/296045
**Category:** Uncategorized
**Created:** [September 9, 2009, 1:07am UTC](https://forum.kirupa.com/t/create-new-object-from-evt-target/296045 "2009-09-09T01:07:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Shaedo](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Shaedo](https://forum.kirupa.com/u/Shaedo)
#### Post date: [September 9, 2009, 1:07am UTC](https://forum.kirupa.com/t/create-new-object-from-evt-target/296045/1 "2009-09-09T01:07:37Z")

</div>

I want to do somthing like this:

```auto
function createObject(evt:Event):void
{
     var myMaskingObject:evt.target = new evt.target;
}

```

This of course throws an errror **1046: Type was not found or was not a compile-time constant: target.**

I want to use this in a class that creates masks of shapes.

I think a possible solution might be in getting the evt.target as a string and then initialising an object from that…

Absolutely any suggestions are welcome!

Thanks.
