# Error when using "dispatchEvent()"

**URL:** <https://forum.kirupa.com/t/error-when-using-dispatchevent/245163>\
**Category:** flash\
**Created:** [November 27, 2007, 2:54am UTC](https://forum.kirupa.com/t/error-when-using-dispatchevent/245163 "2007-11-27T02:54:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradley\_sz](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@bradley\_sz](https://forum.kirupa.com/u/bradley_sz)\
**Post date:** [November 27, 2007, 2:54am UTC](https://forum.kirupa.com/t/error-when-using-dispatchevent/245163/1 "2007-11-27T02:54:12Z")

</div>

G’day all,

I am trying to use “dispatchEvent()” to create a custom event that I have a listener listening out for, and I call out the event as follows:

```auto
dispatchEvent(new Event="End");

```

This returns the following error:

```auto
1105: Target of assignment must be a reference value.

```

How do I go about using this?
