Problems with a button


I’m trying to build a simple typing game, basically a random letter appears on the screen and the user has to type that letter within a certain time limit…Ye sounds crap right? But I’m not trying to compete with rockstar games or anything…its a basic fla so the code can be added to a bigger better game but wanted to test it out first.

Anyway, at the moment lets say ‘F’ comes up…the user has to type ‘F’ into a box then hit enter, which isn’t very easy to do when ur aiming to do it fast. This is my code for the button (enter)…

on (keyPress "<Enter">) {
if (answer == (letter)) {
	 gotoAndPlay ("win");
} else if (answer eq "") {
	 gotoAndStop ("lose");
} else {
	 gotoAndPlay ("lose");

‘letter’ is the randomly generated letter which has to be copied by the user into ‘answer’ the input text box. Is there a way to get rid of the input box and enter button so I could do the same just by hitting one key?

So in effect ‘F’ comes up and the user hits ‘F’ and straight away goes to “win” etc?