flash keyboard input

  • Started
  • Last post
  • 1 Response
  • ctrlRmB

    I'm making a game in flash and trying to decide on the best way to capture key input (UP,DOWN,LEFT,RIGHT)

    I've tried the ways outlined in a few flash books but finding them a bit wonky in treating the movement.

    Does anybody have advice on a preferred way of treating this.

    Thanks in advance

  • ********
    0

    not sure if this is what you looking for. could try this method:

    code:

    onClipEvent (enterFrame) {
    if (key.isdown(key.right) or key.isdown(68)) {
    if (i != 1) {
    this.gotoAndPlay(25);
    i = 1;
    }
    } else {
    this.gotoAndStop(1);
    }
    }