3 Replies Latest reply on Mar 14, 2008 11:09 PM by Newsgroup_User

    Left and right key press going to different markers

    vmansx Level 1
      Hello there does anyone know exactly how to set the key press of the left and right arrow keys on the key board so when i press the left key it goes back a marker and when pressing the right key it goes to the next marker. I am fairly new to lingo so any help would be great and as simple as possible thanks
        • 1. Re: Left and right key press going to different markers
          Wolfgang Herold Level 2
          You can work with "the key" and "the keycode" to verify
          what key was pressed.

          create the following handler in a moviescript to test it.

          on keyup
          put the key
          put the keycode
          end

          now you know the keykodes for
          Left Arrow : "123"
          Right Arrow: "124"

          extent your handler:

          on keyup
          --put the key
          --put the keycode
          case (the keycode) of
          123:
          go previous -- ( go to the previous marker)
          124:
          go next (go to the next marker)

          end case
          end

          now you are able to extend you handler with most keyboard keycodes

          :) Wolfgang

          • 2. Re: Left and right key press going to different markers
            Level 7
            I like to add "unload" right before the go next line.


            "wherold" <webforumsuser@macromedia.com> wrote in message
            news:fr91sv$cet$1@forums.macromedia.com...
            > You can work with "the key" and "the keycode" to verify
            > what key was pressed.
            >
            > create the following handler in a moviescript to test it.
            >
            > on keyup
            > put the key
            > put the keycode
            > end
            >
            > now you know the keykodes for
            > Left Arrow : "123"
            > Right Arrow: "124"
            >
            > extent your handler:
            >
            > on keyup
            > --put the key
            > --put the keycode
            > case (the keycode) of
            > 123:
            > go previous -- ( go to the previous marker)
            > 124:
            > go next (go to the next marker)
            >
            > end case
            > end
            >
            > now you are able to extend you handler with most keyboard keycodes
            >
            > :) Wolfgang
            >
            >
            >


            • 3. Re: Left and right key press going to different markers
              Level 7
              Hi,

              I've created a slide show type application where arrow keys as well as PageUp and
              PageDown were used to move forward and back. Forward and Back were not always
              'previous' or 'next' markers. So, I created buttons on the stage that acted as
              forward and back, and each button had the regular mouseUp event with the link to
              the suitable location. I actually put the buttons off stage and in a movie script
              at:
              on keyDown
              case the keyCode of
              121 : sendSprite (10, #mouseUp) -- pageUp
              116 : sendSprite (11, #mouseUp) -- pageDown
              end case
              end

              Using the 'sendSprite', when the user pressed a key, I could activate the behavior
              attached to the related navigation sprite. And, I could easily add or remove key
              controls by changing the movie script.

              I have more info on using sendSprite, sendAllSprites and call commands at::
              http://www.deansdirectortutorials.com/Lingo/sendSprite.htm

              regards
              Dean

              Director Lecturer / Consultant / Director Enthusiast
              http://www.deansdirectortutorials.com/
              http://www.multimediacreative.com.au
              email: d.utian@unsw.edu.au