2 Replies Latest reply on Jan 8, 2007 11:23 PM by ggshow

    getCode

    dthurwanger
      I am creating an Excel tutorial and am showing navigation. I need to replicate the Excel's action when [Ctrl][Up] are pressed simultaneously. I tried the following, but the ctrl key needs to be released before the up arrow can be pressed. Is there a way to capture both keys being pressed?

        • 1. Re: getCode
          ggshow Level 2
          onClipEvent (keyDown) {
          if (Key.getCode() == 17) {
          _parent.ctrl += "Ctrl";
          } else if (Key.getCode() == 38) {
          _parent.ctrl += "Up";
          }
          }
          onClipEvent (keyUp) {
          _parent.ctrl = "";
          }
          onClipEvent(enterFrame){
          if(_parent.ctrl=="CtrlUp"){
          this._y = 20.6;
          _parent.ctrl = "";
          }
          }

          // happy new year
          • 2. Re: getCode
            ggshow Level 2
            sorry for bug in previous code, press & hold the ctrl key will make prob
            try this:

            onClipEvent (keyDown) {
            if (Key.getCode() == 17) {
            _parent.ctrl = "Ctrl";
            } else if (Key.getCode() == 38) {
            if (_parent.ctrl == "Ctrl") {
            this._y = 20.6;
            _parent.ctrl = "";
            }
            }
            }
            onClipEvent (keyUp) {
            _parent.ctrl = "";
            }