1 Reply Latest reply on Feb 25, 2008 7:02 AM by kglad

    Function fails to work after one execution

    Marinof
      Hi,
      I have made a flash file that doesn't need mouse to use. This is the code for the movement by arrow keys:
      [as]
      var velden:Array = new Array(anaam_txt, vnaam_txt, straat_txt, nr_txt, pc_txt, plaats_txt, email_txt, v1_ja, v2_ja, v3_ja, submit);
      var selectionCounter:Number = 0;
      Selection.setFocus(velden[selectionCounter]);
      var keyListener:Object = new Object();
      keyListener.onKeyDown = function() {
      if (Key.isDown(Key.DOWN) && selectionCounter<10) {
      selectionCounter++;
      Selection.setFocus(velden[selectionCounter]);
      } else if (Key.isDown(Key.UP) && selectionCounter>0) {
      selectionCounter--;
      Selection.setFocus(velden[selectionCounter]);
      }
      };
      Key.addListener(keyListener);
      [/as]
      However the first time it works perfectly.. the second time he skips when navigating trough my textfields.. I tried deleting some vars if clicked on OK but it doens't help? HELP! I need to put this online by tommorow!!
      I tried delteing this
      [as]
      delete keyListener;
      delete focusListener;
      delete selectionCounter;
      delete velden;
      [/as]
      Thnx
      Seba

      PS Complete code attached