I need a little help with a flash login page I am creating. Basically I have the user enter an id# and their name, and when they hit submit, it sends the id # to the database, and returns the name for that id. This part works fine, but when I try to validate whether the returned name matches the name they typed in, it doesn't work even if they are the same. I know the values are the same because I am tracing them both out, so from my testing, etc., I am assuming the variable coming back from the database is not coming through as a string.

I even tried putting the returned variable into another text field, and then testing if the two text fields matched, and it still wouldn't work even though both text fields said the same thing.

Here is my code, thanks for any help!

Code:
myid.text="";
firstname.text="";

mysubmit.addEventListener("click", submitbtn);
function submitbtn(event:MouseEvent){
var myData:URLRequest=new URLRequest("login.php");
	myData.method=URLRequestMethod.POST;
	var variables:URLVariables = new URLVariables();
	
variables.id=myid.text;

	myData.data=variables;
	var loader:URLLoader = new URLLoader();
	loader.dataFormat=URLLoaderDataFormat.VARIABLES;
	loader.addEventListener(Event.COMPLETE, dataOnLoad2);
	loader.load(myData);

}

function dataOnLoad2(evt:Event) {
		trace(evt.target.data.frstname);
		
if(firstname.text==evt.target.data.frstname){
	trace("yes");
}else{
	trace("no");
}

}
stop();