# F\[MX\] listeners

**URL:** <https://forum.kirupa.com/t/f-mx-listeners/7444>\
**Category:** flash\
**Created:** [October 31, 2002, 2:25am UTC](https://forum.kirupa.com/t/f-mx-listeners/7444 "2002-10-31T02:25:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kornkid8281](https://avatars.discourse-cdn.com/v4/letter/k/c67d28/32.png) [@kornkid8281](https://forum.kirupa.com/u/kornkid8281)\
**Post date:** [October 31, 2002, 2:25am UTC](https://forum.kirupa.com/t/f-mx-listeners/7444/1 "2002-10-31T02:25:06Z")

</div>

i was recently working on a project for my new flash site and was pearing into some scripts at [www.flashkit.com](http://www.flashkit.com) and i saw this odd one that have never seen before. what’s a listener?

word,  
alan

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2002, 3:24am UTC](https://forum.kirupa.com/t/f-mx-listeners/7444/2 "2002-10-31T03:24:52Z")

</div>

They have come up with the new even model of Flash MX. Basically, they “listen” for events. I don’t know, for instance, if you want the \_root to do something onKeyDown, well, it won’t work if you just put \_root.onKeyDown=function(){…} because the \_root doesn’t listen to the Key messages by default. Therefore you have to register it as a key listener like so:

Key.addlistener(\_root);

and then you can do whatever you want.

There’s a very good article in the [www.ultrashock.com](http://www.ultrashock.com) tutorials section by Robert Penner, and one too called Flash MX event model at [www.actionscript.org](http://www.actionscript.org) but not quite as good by Guy Watson (he loves metaphors…:P).

pom :cowboy:
