Really Hard Input Text Thing

[FONT=Courier New]Before you get all, *oh, this stuff sounds easy, so I can do it!, *know that I have been working on this one topic for two hours straight. But please help if you can. (Mostly because nobody even looked at my FIRST post.) But anyway, here we go.[/FONT]

[FONT=Courier New]I have been working on a tutorial about Flash, in Flash :grin: and I thought, why not make a “put in the code at the end too see if I’ve really learned this material” at the end? So I did. I explained it, and told the viewers to type it up in the input textbox at the bottom and hit the Enter button. However, after trying mercilessly, the code is even finickier than AS3. No matter what I seem to try, it always tells me I failed, try again.[/FONT]

[FONT=Courier New]I never thought I’d do this, because I think it’s confusing and annoying, but I’m gong to paste the code below so you can understand what is going on.[/FONT]

import flash.events.ActivityEvent;
var reqText = codeTest_inptTxt.text;
var importantNum = reqText.indexOf(“asdf”);
enter_btn.addEventListener(MouseEvent.CLICK, checkText);
function checkText(event:MouseEvent):void{
if(importantNum >= 0){
trace(“YOU MADE AWESOME-LIKE HISTORY!”);
}else{
trace(“Sorry, you failed. Try again.”);
trace(importantNum);
}
}

[FONT=Courier New]Also, be aware that:[/FONT]
[FONT=Courier New]-there is a input textfield called codeTest_inptTxt where you input the “I’ve really learned this material code” thing[/FONT]
[FONT=Courier New][FONT=Courier New]-there is a button called enter_btn for “sending” whatever is in codeTest_inptTxt[/FONT]

Help me if possible. Thanks!

-FlashAj325[/FONT]