Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare array values w/ input filed 1

Status
Not open for further replies.

Micher

Technical User
May 18, 2001
9
CH
Hi Guys!

I want to set up a login area für multiple users and passwords. I tried to do it with the array function, but I got into trouble when trying to compare the values of the array with the input field. The following is my code:
Code:
Daten_Eingabe = varUsername add varPasswort;
// 
function Data (Name, Passwort) {
    this.Name = Name;
    this.Passwort = Passwort;
}
//
var Datensatz = new Array();
Datensatz[0] = new Data("Michael", "Test");
Datensatz[1] = new Data("User2", "Password2");
// 
for (i=0; i<Datensatz.length; i++) {
    if (Daten_Eingabe eq (Datensatz[i].Name add Datensatz[i].Passwort)) {
        _root.gotoAndStop(&quot;ZF_VD&quot;);
    } else {
        gotoAndStop (2);
        Selection.setFocus(&quot;_level0.varUsername&quot;);
        loadVariables (ZF_Sorry, &quot;mvZFComment&quot;);
        varUsername = &quot;&quot;;
        varPasswort = &quot;&quot;;
    }
}
varUsername and varPasswort are the two text input fields. What am I doing wrong? Can you help me please?

Thanks a lot
 
BidBadDave

Thanks for your help! I couldn't actually see what I was doing wrong, but when I pasted your code into my fla it worked!

Regards
MICHER
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top