# Adding events to your own class

**URL:** <https://forum.kirupa.com/t/adding-events-to-your-own-class/254530>\
**Category:** Uncategorized\
**Created:** [March 12, 2008, 10:12pm UTC](https://forum.kirupa.com/t/adding-events-to-your-own-class/254530 "2008-03-12T22:12:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DrZoop](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@DrZoop](https://forum.kirupa.com/u/DrZoop)\
**Post date:** [March 12, 2008, 10:12pm UTC](https://forum.kirupa.com/t/adding-events-to-your-own-class/254530/1 "2008-03-12T22:12:01Z")

</div>

In the Alarm Clock example ([http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs\_Parts&file=00000134.html](http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000134.html)) they create events in their own class–this is exactly what I want. Unfortunately, by extending upon the Sprite class for their class, they assumingly inherit Sprite’s addEventListener, removeEventListener, dispathEvent, etc. How does one create a class that is not extended, but still get the ability to attach events?

In ActionScript 2, I built my own event handling system using Function references since ActionScript 2’s built-in event handling was so convoluted. I could do this again, but I’d rather avoid it if I can make use of ActionScript 3’s event handling.
