Hi guys, I hope anybody can help me close my skinnable popup container. This is for a login form and my problem is it shows up even though I have successfully logged-in.

Here's the code:

public function btnLogin_clickHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub
selectStmt.execute();
var result:SQLResult = selectStmt.getResult();
var i:int = 0;
for (i=0; i < result.data.length; i++) {
var row:Object = result.data[i];
if(txtUsername.text != row.userName || txtPassword.text != row.userPassword || txtUsername.text == "" || txtPassword.text == ""){
(new AlertMsg()).open(this, false);
}
else{ ----> if this is true the alert message still shows up.
navigator.pushView(views.HomeView);
}
}
}


Any response would be greatly appreciated. Thank you!