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
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