3 Replies Latest reply on Dec 28, 2007 2:45 AM by budgiebird

    keydown- keycode help

    RafNeron
      Hi, I want to use th "on keydown" function to, for example, pause a movie or go back to the main menu. The problem is I can't find working keycodes except RETURN. Using RETURN works in this script:

      on keyDown
      if (_key.key = RETURN) then _movie.go("start")
      end keyDown

      I have try to change RETURN for SPACE or 49 (keycode for the spacebar) and it does not work.
      I hope this is clear, doing my best to write in english.
      Anybody could help please?
      Thanks
        • 1. Re: keydown- keycode help
          Level 7
          on keyDown
          case the key of
          "a","b","c":
          put "w00t!"
          RETURN,ENTER,TAB:
          put "Happy Christmas!"
          "1","2","3":
          put "Happy Channukah!"
          " ":
          put "That was a spacebar"
          end case
          end

          RafNeron wrote:
          > Hi, I want to use th "on keydown" function to, for example, pause a movie or go
          > back to the main menu. The problem is I can't find working keycodes except
          > RETURN. Using RETURN works in this script:
          >
          > on keyDown
          > if (_key.key = RETURN) then _movie.go("start")
          > end keyDown
          >
          > I have try to change RETURN for SPACE or 49 (keycode for the spacebar) and it
          > does not work.
          > I hope this is clear, doing my best to write in english.
          > Anybody could help please?
          > Thanks
          >
          • 2. Re: keydown- keycode help
            RafNeron Level 1
            Really helpful, thanks.
            • 3. Re: keydown- keycode help
              budgiebird Level 1
              Hi RafNeron
              A method I use is to write, for example
              if myKey = numtochar(49) then
              member("StartStop").line[1] = "1"

              Then when you leave that frame, etc write
              member("StartStop").line[1] = "0"

              to reset the system.

              By having in the movie, a global script monitoring the containers, for example,
              if member("StartStop").line[1] = "1" then

              you can use the same script for the keys, and in the global script vary what happens dependent on circumstance.
              So in one instance the default for that key maybe to start a movie but in another instance it would be to return to the main menu.
              Hope this helps
              Excellent English by the way ;-)
              Happy New Year, Ron