Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keypad Problems

Status
Not open for further replies.

lumstar

Technical User
Jan 29, 2002
177
CA
I have created an ATM interface for a training guide I am creating. For one section which requires user input, I need to make it so that as a user clicks a key on the keypad (1-9 and 0) it displays that number. This i have been able to do. However, by pressing the same key a second time i want the key to display A by pressin it again it displays B again displays C a fourth press brings it back to 1. This allows for alphanumeric input.

I was able to do this, but cannot seem to make it so that pressing a different key adds to the string in the variable, rather than completely over-writing it.

the code I am using is as follows (so far only 2 keys setup where "text" is the dynamic script box):

in the first frame:

key1 = new Array("1", "A", "B", "C");
count = 0;
key2 = new Array("2", "D", "E", "F");
count = 0;
text1 = "";
stop ();


on the buttons:

on (release) {
text = text + key1[count];
count++;
if (count>=4) {
count = 0;
}
}



Thanks in advance!
Lumstar
 
key1 = new Array("1", "A", "B", "C");
count = 0;
key2 = new Array("2", "D", "E", "F");
count = 0;
text1 = "";
stop ();


on the buttons:

on (release) {
//text = text + key1[count];
text = key1[count];
count++;
if (count>=4) {
count = 0;
}
} Regards

Big Bad Dave

logo.gif


davidbyng@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top