1 Reply Latest reply on May 1, 2006 5:19 PM by Newsgroup_User

    Key Press not working for PageUp/PageDown

    victorhooi
      heya,

      I'm creating a slide presentation in Flash, using the "Technology" slide template. The sample code lets you use the left/right arrow keys to navigate the slides, and I'm trying to add the PageUp/PageDown keys to this (since the wireless presenter I'm using sends PageUp/PageDown).

      The original code is here:

      // When the keyboard keys are pressed
      var keyListener = new Object();
      keyListener.onKeyDown = function () {
      if (Key.isDown(37)) {
      // Left
      updateFrame(-1);
      } else if (Key.isDown(38)) {
      // Up
      updateFrame(-(_currentframe-1));
      } else if (Key.isDown(39)) {
      // Right
      updateFrame(1);
      } else if (Key.isDown(40)) {
      // Down
      updateFrame(_totalFrames + 1);
      }
      }
      Key.addListener(keyListener);

      The PageUp/PageDown keys are meant to be key codes 33 and 34 - inserting them into the above didn't work (even directly replacing the 37 with a 33 didn't work), and nor did using Key.PGDN and Key.PGUP instead of integers.

      Any suggestions?

      Thanks,
      Victor
        • 1. Re: Key Press not working for PageUp/PageDown
          Level 7

          > The PageUp/PageDown keys are meant to be key codes 33 and 34 - inserting them
          > into the above didn't work (even directly replacing the 37 with a 33 didn't
          > work), and nor did using Key.PGDN and Key.PGUP instead of integers.
          >

          This is probably only happening in the testing environment (i.e.
          Ctrl-Enter / "Test Movie")?

          Try choosing "Control>Disable Keyboard Shortcuts" in your test movie
          window. Then try the PGUP & PGDN keys. They should work.

          If you view the movie in a browser it should work right away, too.