4 Replies Latest reply on Jul 15, 2006 12:41 PM by Rich_Slack

    Arrow keys for frame advancement

    Rich_Slack
      I am doing a corporate training video that is branded for our company. It is integrated with video and slides. I have already set everything up as far as navigating with buttons and now thanks to Dave mouse clicks. The last thing I need is for the frames to be advanced based on the left and right arrow key. From my research I think the arrow keys are 123 and 124 but I am not sure which handlers to use and if these are the right key mapping numbers for arrow keys. Thanks in advance!
        • 1. Re: Arrow keys for frame advancement
          Level 7
          Left is 123, right is 124. You can just google "Director key codes", the
          first item will be the key code page from the Director tech notes.

          To use these, you need to set a keyDownScript and then interpret the key
          hits:

          in a movie script window:
          ----------
          on startMovie -- for instance
          the keyDownScript = "checkForKeys"
          end

          on checkForKeys
          case (the keyCode) of
          123: go to the frame -1
          124: go to the frame + 1
          end case
          end
          ----------


          If there is anywhere in the movie where you don't want the keys to work,
          just set the keyDownScript = "", and then if you want to use it again,
          reset it to checkforKeys

          --
          Rob
          _______
          Rob Dillon
          Adobe Community Expert
          http://www.ddg-designs.com
          412-243-9119

          http://www.macromedia.com/software/trial/
          • 2. Re: Arrow keys for frame advancement
            Rich_Slack Level 1
            Right now I have a video that plays and when it is done it advances to the next frame to view powerpoint type slides (not actually powerpoint but same effect). On each frame I have the following script: The lower portions of the script work fine (right mouse left mouse) go to the frame to pause etc. I inserted your script above all these and it did not work. I am sure the error is on my end, can you tell from the script what I am doing wrong? I changed "on startMovie" to "on enterFrame me" as I am dealing on a frame by frame basis for the powerpoint type slide portions. Thanks AGAIN!
            • 3. Re: Arrow keys for frame advancement
              Level 7
              For one thing, the 1st bit should NOT be on enterFrame. As Rob used in
              his example, it should be in a MOVIE script and should take place before
              you ever get to a place where it will be needed (like startMovie)

              on startMovie -- for instance
              the keyDownScript = "checkForKeys"
              end

              What that does is tell Director to use the "checkForKeys" handler
              whenever a key is pushed down. You don't want to do that every
              enterFrame. It should only be done once. Then Director will know what
              to do.

              The checkForKeys handler needs to be in a movie script. I can't tell by
              your code if it is a movie script (which would be global for the whole
              project) or a frame script, just for that frame.

              If you do not want to have the keys react on some frames but you do want
              them to work on others, you would need to code that in. One way is to
              set the keyDownScript=VOID for frames that don't need it and reset it
              when it is needed.

              Another way is to change the checkForKeys handler to deal with frame
              numbers. This one will make the arrow keys work, but only if the
              playhead is on frame 100 or higher:

              on checkForKeys
              if (the frame)<100 then pass
              case (the keyCode) of
              123: go to the frame -1
              124: go to the frame + 1
              end case
              end
              • 4. Re: Arrow keys for frame advancement
                Rich_Slack Level 1
                Thank you both very much! I did some quick research into MOVIE SCRIPTS and it is now working like a charm. My confusion came because of my ignorance of Movie scripts as applied to the whole movie. My navigation is now complete thanks to your help.