Copier le lien dans le Presse-papiers
Copié
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.
Copier le lien dans le Presse-papiers
Copié
Embed the fonts for the dynamic/input textfields.
Copier le lien dans le Presse-papiers
Copié
Thank you Ned
Copier le lien dans le Presse-papiers
Copié
You're welcome
Préparez-vous ! Une expérience Adobe Community améliorée arrive en janvier.
En savoir plus