# Proper syntax when dispatching a custom event

**URL:** <https://forum.kirupa.com/t/proper-syntax-when-dispatching-a-custom-event/291922>\
**Category:** flash\
**Created:** [July 7, 2009, 4:14pm UTC](https://forum.kirupa.com/t/proper-syntax-when-dispatching-a-custom-event/291922 "2009-07-07T16:14:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![creatify](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@creatify](https://forum.kirupa.com/u/creatify)\
**Post date:** [July 7, 2009, 4:14pm UTC](https://forum.kirupa.com/t/proper-syntax-when-dispatching-a-custom-event/291922/1 "2009-07-07T16:14:46Z")

</div>

Just a curious question - i have a class where I’m setting a simple custom event name as a static const such as:

```auto

public static const ON_OVER:String = "HotSpot_ON_OVER";

```

When an instance is created in parent container object, I’m simply using:

```auto

theInstance.addEventListener(HotSpot.ON_OVER, hsOverHandler);	

```

Within the HotSpot class, when I dispatch that event - both of the following work, **but is one preferred or more proper than the other?**

```auto

dispatchEvent(new Event(HotSpot.ON_OVER));
//or
dispatchEvent(new Event(ON_OVER));

```
