# Keypad-keycode verification

**URL:** <https://forum.kirupa.com/t/keypad-keycode-verification/57596>\
**Category:** Uncategorized\
**Created:** [July 14, 2004, 3:31pm UTC](https://forum.kirupa.com/t/keypad-keycode-verification/57596 "2004-07-14T15:31:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![p\_due18](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/p_due18/32/347_2.png) [@p\_due18](https://forum.kirupa.com/u/p_due18)\
**Post date:** [July 14, 2004, 3:31pm UTC](https://forum.kirupa.com/t/keypad-keycode-verification/57596/1 "2004-07-14T15:31:32Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2004, 3:55pm UTC](https://forum.kirupa.com/t/keypad-keycode-verification/57596/2 "2004-07-14T15:55:23Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2004, 3:59pm UTC](https://forum.kirupa.com/t/keypad-keycode-verification/57596/3 "2004-07-14T15:59:37Z")

</div>

> [@The Reefster](#):
>
> 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:
> 
> ```auto
> on (release) {
> if (code **.text** == "111") {
> gotoAndStop(10);
> } else {
> gotoAndStop(1);
> }
> }
> 
> ```

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2004, 4:00pm UTC](https://forum.kirupa.com/t/keypad-keycode-verification/57596/4 "2004-07-14T16:00:45Z")

</div>

Lol no problem ;).
