Actionscript login

Hi guys,

So I decided to train my actionscript skill a bit by creating a login from scratch. I’m already into PHP so it wasn’t that hard creating the code with some arrays and stuff. And it worked 100%. Now this might seem a bit odd but I decided to create it again to clean everything up and make it look nice (both design- and code-wise). But now I can’t get it to work! Could you guys help me out?

I have two input text’s called username and password and a button with this actionscript:

on (release) {
funclogin ();
}

And here is the code / function: (the x’s are just to check something out)

stop ();
function funclogin () {
	usernamex = new Array ();
	passwordx = new Array ();
		usernamex[0] = "goat"; passwordx[0] = "123";
		usernamex[1] = "sheep"; passwordx[1] = "321";
	if (username.text == "" and password.text == "") {
		errorx.text = "Wrong info!";
	} else if (username.text == "") {
		error.text = "Fill out username!";
	} else if (password.text == "") {
		errorx.text = "Fill out password!";
	} else {
		i = 0;
		while (stopArray == "") {
			if (usernamex* == username.text and passwordx* == password.text) { loginTrue = 1; }
			if (usernamex* == "" and passwordx* == "") { stopArray = 1; }
			i = i + 1;
		}
		if (loginTrue == 1) gotoAndStop (2);
	}
}

:crazy: