Skip to main content
October 4, 2015
Answered

problem with dynamic text box and input box

  • October 4, 2015
  • 1 reply
  • 541 views

wtf.dib

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.

This topic has been closed for replies.
Correct answer Ned Murphy

Embed the fonts for the dynamic/input textfields.

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
October 4, 2015

Embed the fonts for the dynamic/input textfields.

October 4, 2015

Thank you Ned

Ned Murphy
Legend
October 4, 2015

You're welcome