Are userName and password variables? If they are text fields as I think they might be you need to put userName.text and password.text
Hi there, Trying to implement a login element to my site where access will be granted to a secret section of the site upon using the correct user name and password. I will using attchMovie to display an error message if they are incorrect and will jump to the secret section using gottoandplay with frame labels. To check the if/else i am simply jumping to a label on each condition. Even if i input the correct username and password it still jumps to contactspage? Any ideas. The code was taken from a past thread by KGlad. The code i am using is as follows: on (release, keyPress "<Enter>") { if (userName == "Vantage" && password == "Bauer") { _root.gotoAndPlay ("homepage"); } else { _root.gotoAndPlay ("contactspage"); } }
Code seems fine as posted. You may want to trace userName and password inside the on. You also might want to be sure there are no other gotoAnd.. statements in other parts of code. Use the MovieExplorer to see all code. on (release, keyPress "<Enter>") { trace (userName); trace(password); if (userName == "Vantage" && password == "Bauer") {
The code you posted would only work if you set a var using the property inspector. If you use instance names then you need to check the text property: if (userName.text == "Vantage" && password.text == "Bauer") {
textfield.password = true;
Thanks for the feedback. Both the instance name and var were set. When the var is set i get the following appear in the input boxes? _level0.instance10.login _level0.instance10.password I have tried the suggested methods and both still jump back to the same 'contacts' page and not 'home' if right contacts if wrong? There is definetaly no other command sending you to another label or frame?
Set the password property of the text field to true: password_txt.password = true;
Don't see what you're looking for? Try a search.
|