Copy link to clipboard
Copied
I am trying to make a login screen for a game. I imported the background image added 5 text boxes and 2 buttons
the top one is dynamic and is supposed to show the message. The Username or Password is incorrect as is shown in the trace, but that is what appears instead.
the two left boxes are static and seem to be working fine.
the 2 boxes on the right are input boxes for the user to enter in their username and password, but the only alpha characters they allow are a d e m n o p r s u w.
any other alpha chars get ignored. and u n p are always in capital.
I realize that the only letters that seem to be allowed are the letters in User Name & Password, but I have no idea why this is happening.
here is the code for the login.
stop();
import flash.events.MouseEvent;
import flash.ui.Mouse;
import flash.display.MovieClip;
import flash.events.Event;
import flash.display.Stage;
loginbtn.addEventListener(MouseEvent.CLICK, login);
function login(event:MouseEvent)
{
if(usernametxt.text=="u" && passwordtxt.text=="p")
{
gotoAndPlay(2);
}
else
{
messagetxt.text = String(" The Username or Password is incorrect ");
trace(messagetxt.text)
}
}
any help would be greatly appreciated.
Embed the fonts for the dynamic/input textfields.
Copy link to clipboard
Copied
Embed the fonts for the dynamic/input textfields.
Copy link to clipboard
Copied
Thank you Ned
Copy link to clipboard
Copied
You're welcome
Find more inspiration, events, and resources on the new Adobe Community
Explore Now