2 Replies Latest reply on Nov 23, 2007 1:17 PM by DV90

    Setting and Checking Variables

    DV90
      Hello, I am trying to create a game where when the "x" key is pressed it sets the value of a variable (acid) to 1. Meanwhile, a MC is checking to see if acid = 1 and if it does, it tells another MC to gotoAndPlay a certain frame. Here are my codes:

      Frame 1 (Declaring the variable):
      var acid = 0


      Frame 1 (MC that checks Acid=1):
      onClipEvent (enterFrame) {
      if (acid == 1) {
      _root.player_mc.gotoAndPlay("acidgun");
      }
      }

      Code that sets Acid to 1:
      if (Key.getCode() == 88) {
      acid=1;
      }

      I need help fast! Please HELP! plz!?
      Thank you in advance...
      DV90