# And. Not Or!

**URL:** <https://forum.kirupa.com/t/and-not-or/319193>\
**Category:** flash\
**Created:** [February 11, 2011, 12:02pm UTC](https://forum.kirupa.com/t/and-not-or/319193 "2011-02-11T12:02:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![damienAlbern](https://avatars.discourse-cdn.com/v4/letter/d/f17d59/32.png) [@damienAlbern](https://forum.kirupa.com/u/damienAlbern)\
**Post date:** [February 11, 2011, 12:02pm UTC](https://forum.kirupa.com/t/and-not-or/319193/1 "2011-02-11T12:02:11Z")

</div>

Hi all, just a quick question.  
I am trying to create a menu where the user must enter a “1” in the input textfield AND press enter for the next menu item to come up. At this point in time the code I am using brings the menu up if I press “1” OR the Enter key. I have limited the input textfield to just one character, but I am not quite sure about the charCodeAt statement. Does charCodeAt(0) refer to the first key pressed during a KeyboardEvent or does it imply the character at the first position of a textfield? please explain.

```auto
    
function capturenumberofBallstextInput(event:KeyboardEvent):void {
            numberofBallstextInputcapture = (event.charCode);
            
            if (event.charCode == "1".charCodeAt(0) && 13) {
                addChild(sizeofBall1);
                addChild(sizeofBall1textInput);
            }

```

thanx  
damienA
