1 Reply Latest reply on Aug 26, 2008 5:11 PM by Nightkarnation

    Key.ENTER performing action in more than one layer

    Nightkarnation
      Ok in Layer (5) i have this relevant code:


      Code:
      //IF ENTER KEY...GO TO btnSend
      k = new Object();
      k.onKeyDown = function() {
      if (Key.getCode() == Key.ENTER && txtSubmit.text != "") {
      sendIt();
      }
      };
      Key.addListener(k);
      And on layer (10) i have the following:


      Code:
      //IF ENTER KEY...trace example
      k2 = new Object();
      k2.onKeyDown = function()
      {
      if (Key.getCode() == Key.ENTER && txtSubmit.text != "")
      {
      trace("working");
      }
      };
      Key.addListener(k2);
      When i hit ENTER on layer 10... the action sendIt() from layer (5) is performed...

      What i may be doing wrong ?