0 Replies Latest reply on Nov 21, 2006 9:51 AM by Ricky2k7

    Memory Game

    Ricky2k7 Level 1
      Hey!
      I’m creating a “memory game” in flash 8. For now, I’m trying to do it with only 3 objects.
      In these 3 objects, objA corresponds with objB. When objA and objB are selected, “nice” will appear in the main timeline.
      I’m having trouble corresponding objA and objB. This is the code I have for each object, can anyone tell me what I’m doing wrong?

      object1:
      onClipEvent(load)
      {
      objA=1;
      }
      on (press)
      {
      objA=A;
      gotoAndPlay("active");
      }
      on (release)
      {
      if (objA==A && objB==B)
      {
      _root.gotoAndPlay("nice");
      } else {
      this.gotoAndPlay("inactive");
      }
      }

      object2:
      onClipEvent(load)
      {
      objB=1;
      }
      on (press)
      {
      objB=B;
      gotoAndPlay("active");
      }
      on (release)
      {
      if (objA==A && objB==B)
      {
      _root.gotoAndPlay("nice");
      } else {
      this.gotoAndPlay("inactive");
      }
      }

      object3:
      onClipEvent(load)
      {
      objC=1;
      }

      on (press)
      {
      objC=C;
      gotoAndPlay("active");
      }

      on (release)
      {
      if (objC==C && objD==D)
      {
      _root.gotoAndPlay("nice");
      } else {
      this.gotoAndPlay("inactive");
      }
      }