1 Reply Latest reply on Feb 7, 2008 6:26 AM by Gregory Lafrance

    ENTER Key

    vij010
      Is this the correct way to check for the ENTER key ?

      public function initApp():void
      {
      stage.addEventListener(KeyboardEvent.KEY_DOWN,testcheck)
      }


      public function testcheck(button1:KeyboardEvent):void
      {
      if(button1.keyCode==13)
      {
      Alert.show('This works');
      }
      }


      The id for my button on the stage is button1. I tried using the code button1.addEventListener, the code failed there, I also added stage.addEventListener(what I am using now), this also fails....so I presume that something's not right here...

      The help for this is not very clear...