Hi,
Try swapping the order of the if statements around, so
if (attempt == 0) {
app.alert("You do not have authentication for that mode.");
app.setTimeOut("this.closeDoc(true)", 2000);
} else {
if (attempt <= 3) {
app.alert(String.concat("Invalid username and/or password. You have ", attempt, " left."));
attempt--;
}
}
Is this code in a script object? and how are _Username and _Password declared, you have to be carefull that these don't get removed by the garbage collector