3 Replies Latest reply on May 21, 2007 9:48 PM by kglad

    There an easier way to do this?

    KidgamezRoshan
      I've been programming for a while, i learned by examples and playing with the script.. but now that im creating more advanced programs, i think my scripts are a bit longer than they should be. Such as:

      if (weaponmax1 == 2) {
      p1w2._visible = "0";
      p1w3._visible = "1";
      p1w4._visible = "1";
      p1w5._visible = "1";
      p1w6._visible = "1";
      } else if (weaponmax1 == 3) {
      p1w2._visible = "0";
      p1w3._visible = "0";
      p1w4._visible = "1";
      p1w5._visible = "1";
      p1w6._visible = "1";
      } else if (weaponmax1 == 4) {
      p1w2._visible = "0";
      p1w3._visible = "0";
      p1w4._visible = "0";
      p1w5._visible = "1";
      p1w6._visible = "1";
      } else if (weaponmax1 == 5) {
      p1w2._visible = "0";
      p1w3._visible = "0";
      p1w4._visible = "0";
      p1w5._visible = "0";
      p1w6._visible = "1";
      } else if (weaponmax1 == 6) {
      p1w2._visible = "0";
      p1w3._visible = "0";
      p1w4._visible = "0";
      p1w5._visible = "0";
      p1w6._visible = "0";
      }

      I know a lot of ways to do this script, one would be adding a script like:

      if (_root.weaponmax1 > 3){
      _visible = "1"
      } else() {
      _visible = "0"
      }

      i could add that within each movie clip called p1w2 and p1w3 and so on..

      im just wondering if theres a quicker method than all of this? im encountering this problem a lot.

      BTW i am still using flash MX lol.

      can anyone help?