1 Reply Latest reply on Jul 12, 2008 7:16 AM by kglad

    help with this code please

    vohyndras
      hello there im new in flash andi wounder if any one can help me
      im recibing from a php page 250 variables and i have 250 buttons on my flash
      im recibing the variables like his &depto1=Cerrado&depto2=Apartado&depto3=Disponible&depto4=Cerrado&depto5=Cerrado.......... .&depto250=Cerrado
      what i whant to do is that if the variables = Cerrado thebutton would be disable, if the varable = Apartado the button will be alpha 30; and if the varaibel = Disponible, Nothig happens.
      i dont whant to write 250 times this


      if (depto1 == "Cerrado") {
      BTNdepto1.enabled = false;
      BTNdepto1._alpha = 0;
      } else if (depto1 == "Apartado") {
      BTNdepto1.enabled = false;
      BTNdepto1._alpha = 30;
      }


      so im using this but its not working



      for (var i:Number = 1; i <= 250; i++){
      if (BTNdepto + i == "Cerrado"){
      (BTNdepto + i).enabled = false;
      (BTNdepto + i)._alpha = 0;
      } else if (BTNdepto + i == "Apartado"){
      (BTNdepto + i).enabled = false;
      (BTNdepto + i)._alpha = 50;
      }
      }

      could any one help me please ......
      thanks.....