Keypad-keycode verification

Hi guys, I’m stuck, please help…

I’m creating a keypad which uses buttons to enter numbers into an input textfield.

I can get the buttons to enter numbers into the field but can’t figure out how it knows the code is correct.

I’ve attached the fla to explain what I mean.

Code used so far:

On button 1:
[INDENT]on (press)
{
this.number=‘1’
}

on (press)
{
_root.code.text+=this.number;
}[/INDENT]

on the Submit button:
[INDENT]on (release)
{
if (code == “111”)
{
gotoAndStop(10);
}

else
{
gotoAndStop(1);
}
}[/INDENT]

If you’re dealing with numbers, you should’ve used the textboxes variable instead of instance name. I don’t know, it’s sort of confusing but try this instead of what you had for the submit button:

on (release) {
    if (code**.text** == "111") {
      gotoAndStop(10);
    } else {
      gotoAndStop(1);
   }
}

Oh yeah should have thought of that, thanks mate, works fine now.
Cheers :slight_smile:

Lol no problem ;).