# Listener

**URL:** <https://forum.kirupa.com/t/listener/19022>\
**Category:** Uncategorized\
**Created:** [April 23, 2003, 4:05pm UTC](https://forum.kirupa.com/t/listener/19022 "2003-04-23T16:05:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![starfall](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@starfall](https://forum.kirupa.com/u/starfall)\
**Post date:** [April 23, 2003, 4:05pm UTC](https://forum.kirupa.com/t/listener/19022/1 "2003-04-23T16:05:32Z")

</div>

need help understanding listener for keys being pressed using flash mx

making typing tutor – only interested in key presses – no buttons

intend to make graphic of each key placed upon grid that simulates keyboard key positions

intend to make movie clip for each key that animates to prompt  
user to press key at appropriate time

intend to place static graphic of key and movie clip of same key  
in exactly same position on layer for key and use visibility  
property to turn appropriate image on or off

in trying to experiment with listener, textbook showed me this:

Key.addListener(\_root);  
\_root.onKeyUp=function()  
{trace(Key.getAscii());}

if you place this in new movie on first frame and run movie,  
it does, in fact, allow for key press to display ascii code  
to screen

made typing tutor movie with layer for each key and  
placed static movie clip of key in layer of same name  
– added actions layer and placed above code in frame  
(only one frame for all layers)

code does not function as it did in new movie alone

why ?

---

<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:** [April 23, 2003, 5:18pm UTC](https://forum.kirupa.com/t/listener/19022/2 "2003-04-23T17:18:28Z")

</div>

can you send me the file? it should work fine regardless of the content of your flash movie. Either attach the file here or send it to _ **Email Removed** _
