Im trying to create a game for my 1 year old in flash that shows a letter on the screen. He has to press that letter on the keyboard to move on to the next letter.
So far Ive got this...(for letter a)
- Code: Select all
stop ();
var myListener:Object = new Object();
myListener.onKeyDown = function() {
if (Key.getCode() == 65) {
play();
}
};
Key.addListener(myListener);
the problem is, when I get to letter b and put this...
- Code: Select all
stop ();
var myListener:Object = new Object();
myListener.onKeyDown = function() {
if (Key.getCode() == 66) {
play();
}
};
Key.addListener(myListener);
"a" still works. How can I make it so the listener, "resets" or "forgets" any previous letter?
Thanks!
Rich



