Flash Username/Password action questions....

RebelToRumble

Veteran X
Ok here's the lowdown...

I have two text fields, one is input, one is password.

Input is named UN, password is named PW.

I have a enter button that has an action script applied to it.

I want it to be able to have two users that are able to log onto whatever i end up putting it on...

The button's script is:

Code:
on (release)

{

	{
		if (pw == "password1" && un == "username1")
			{gotoAndPlay("username1");} 
 		else 
			{gotoAndPlay("wrong");}
	}

	{  
 		 if (pw == "password2" && un == "username2") 
			{gotoAndPlay("username2");}
 		else 
			{gotoAndPlay("wrong");}
	}
}

There are no syntax errors showing, but only the second username "username2" works, "username1" only goes straight to "wrong".

Here's the files i made:

http://rebel.fluxd.com/hosted/Help.swf
http://rebel.fluxd.com/hosted/Help.fla

Anyone know what's wrong so that both users can't work?

Im confused...the first user works when i take OUT the second users actionscript, but not when i put it in...
Thanks.
 
maybe this: {gotoAndPlay("username1");}

really points to this: {gotoAndPlay("wrong");}


did you try replacing username1 with username2 in the first gotoandplay?
 
Somec said:
maybe this: {gotoAndPlay("username1");}

really points to this: {gotoAndPlay("wrong");}


did you try replacing username1 with username2 in the first gotoandplay?

I just switched them and it still does the same thing...no matter what it is the second in line (this time it was username1) is the only one that works...

I think it's a problem with having two of them in the same actionscript but somewhere on flashkit said you could have multiple users...

Im confused about how i should go about having multiple users, because they tutorial on flashkit didnt explain...
 
oh, i don't know then - haven't worked with flash at all... is there any way you can stick both pieces of code into the same { } block?
 
thats how i had it, but its only recognizing the second script, there are no syntax errors....

God...i just seperated the two and it still doesnt work!!!

Christ...

thanks though.
 
why do you have two elses that do the same thing? :p

on (release) {
if (pw == "password1" && un == "username1") {
gotoAndPlay("username1");
} else if (pw == "password2" && un == "username2") {
gotoAndPlay("username2");
} else {
gotoAndPlay("wrong");
}
}
 
Back
Top