Problems creating a debug console

I have a platformer with a level editor built in, and I would like to create a console to allow the users to type in simple text commands (“new map 20 40”) to call functions I have set up.

I created a class Console that is an input text box. It sits at the top of the screen and is toggled with the (/~) key; however, sometimes when I toggle the console, no text appears and I can't activate the text box by clicking on it. It seems that it works when I type something into it before I first deactivate it, but the ideal usage would be, when I press (/~), the console appears with the cursor in it at the initial location.

Does anyone have any insight into this problem?

This is an AS3/Flex 3.4 application running in Flash 10. I didn’t use the IDE to create it, and I don’t plan to.

The project is too large for Kirupa forums. Get it at http://drop.io/consolehelp