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 ?