- Home
- Tutorials
- Flash
- Intermediate
- Centralized Event Management in ActionScript 3

Who What Where
Patrick Cousins
I have been a professional Flash/Flex/ActionsScript developer, designer and animator for almost 10 years now. Holding up in Brooklyn, NY I recently developed sites for the Marines, Nokia, Smirnoff and too many others to go on with a silly list like this. Originally I started out as a web designer for a video game company way back in the days of Flash 3. Luckily, I was in the right place at the right time and learned programming logic from the old-school assembly and C++ programmers there while I taught myself Flash's as it grew to version 5 and its fancy new ECMA based syntax. Feel free to check out my blog for more tutorials and scripts at: http://pajamacode.pj-co.com/.
And so now that I am passing my version of this EventManager along, I wanted to give credit where it’s due. And although the features of my EventManager are different, Jason Cook's EventCenter was the inspiration to everything that follows in this tutorial.
As a side note, there are some who might debate the merits of such a system of events and consider it bad OOP. While I respectfully disagree, please see this forum post to delve into that discussion if you wish.
Okay, phew -- we got that cheesy intro friendly banter paragraph out of the way, so let’s dig into the nitty gritty!
Why?
What do we hope to accomplish:
- Provide a central place that objects and classes can connect to as listeners and jam out while listening to that great new wave event music.
- Loosen the coupling in our applications and websites by allowing objects to remain unaware of each other. Loosen our ties too! (who wears ties?)
- Enable debugging of the sequence our events are firing. (what did that event just say to me?)
- Provide new functionality to remove all listeners. (Or tell all those long-winded-jabber-mouth broadcasters they need to hush up!)
- Add a new longevity feature to listeners and dispatchers. (Some need life support!)
Who?
Not for Everyone. This tutorial is for the following people and/or robots:
- Intermediate ActionScript 3 developers.
- Basic understanding of OOP and class inheritance.
- Those with a working knowledge of events.
- Banana enthusiasts.
What?
What are some of the things this system could be used for?
- Small “postcard” or portfolio websites.
- Flash games
- Interactive banner ads and Rich Media.
Not?
I don’t like to admit this in public but it’s true that there is some stuff centralized event management isn’t cut out for:
- Complex Applications
- Projects with multiple ActionScript developers
- Anything where the complexity is enough to justify a framework
- NASA rovers

