Help with loading external text file

I have the following code with an external text file. The text file is passwords.txt with one line: content=thetext. If I put a trace (shown in this example) and click the enter button, the trace shows undefined. If I click retry and click the enter button again, the trace then shows thetext. Why is it showing undefined the first time you click it?

on (release, keyPress “<Enter>”) {
var Passtest = new LoadVars();
Passtest.onLoad = function(){
firstpass = this.content;
}
Passtest.load(“passwords.txt”);
trace(firstpass);
if(password == firstpass){
password="";
getURL(“http://www.xyz.com”);
} else {
gotoAndStop(“wrong”);
}
}