Hello,

I've managed to get a User Login working for my website. The users details are kept on a separate .txt file in the same directory, called members.txt.
Here's how the text file looks:

Code:
memberData=User1,password1,[email protected],6
User2,password2,[email protected],4&
&eof=yes&
The login button is coded as follows:

Code:
on (release, keyPress "<Enter>") {
	user=user;
	for (var ndx = 0; ndx<totalMembers; ++ndx) {
		if (user == memberArray[ndx][0]) {
			if (pass == memberArray[ndx][1]) {
				gotoAndStop("Website", 1);
				success = true;
				userlevel = memberArray[ndx][3];
				youremail=memberArray[ndx][2];
				password=memberArray[ndx][1];
				Submit = "Yes";
			}
		}
		if (false == success) {
			gotoAndStop(4);
			error = "Login details incorrect. Please try again.";
		}
	}
}
The login works fine. See the numbers at the end of each line in the members.txt file? That's the user permission level. I've got a button (only accessed once logged in) that requires the user's level to be at least 5. As you can see, I've got two users so far, one is level 4, one is level 6. I've done this so I can test this section out.

My problem is that both users can still access the level 5 section. Here's the code on the button:

Code:
on (release) {
	_root.userlevel = memberArray[ndx][3];
	trace(_root.userlevel);
	// what is the result ?
	trace(typeof _root.userlevel);
	// what is the result ?
	trace(ndx);
	// is this index number viable ?
	trace(memberArray[ndx][3]);
	// undefined ??
	trace(_root.memberArray[ndx][3]);
	// what result here with _root.prefix ??
	if (_root.userlevel>="5") {
		pages.gotoAndStop("special");
	}
	// end if
}
Also, from the traces in that code, I get the following results:

Code:
undefined
undefined
2
undefined
undefined
Can anyone see what I've done wrong here? Any help is greatly appreciated.

Thanks.