4 Replies Latest reply on Oct 7, 2009 2:05 PM by kglad

    I know this can be shortened but i'm stuck trying

    Yakamazi_nev

      Hi all

       

      I'm so sure that this can be shortened but i'm having real difficulties with the for, and if statements, and the orders.. i figure why suffer over it... get some help.

       

      heres the code:

       

      if ((dat) >= "1") { block_1._alpha = 50; }

      else { block_1._alpha = 100;}

       

      if ((dat) >= "2") { block_2._alpha = 50; }

      else { block_2._alpha = 100;}

       

      if ((dat) >= "3") { block_3._alpha = 50; }

      else { block_3._alpha = 100;}

       

      if ((dat) >= "4") { block_4._alpha = 50; }

      else { block_4._alpha = 100;}

       

      if ((dat) >= "5") { block_5._alpha = 50; }

      else { block_5._alpha = 100;}

       

      if ((dat) >= "6") { block_6._alpha = 50; }

      else { block_6._alpha = 100;}

       

      if ((dat) >= "7") { block_7._alpha = 50; }

      else { block_7._alpha = 100;}

       

      if ((dat) >= "8") { block_8._alpha = 50; }

      else { block_8._alpha = 100;}

       

      if ((dat) >= "9") { block_9._alpha = 50; }

      else { block_9._alpha = 100;}

       

      if ((dat) >= "10") { block_10._alpha = 50; }

      else { block_10._alpha = 100;}

       

      if ((dat) >= "11") { block_11._alpha = 50; }

      else { block_11._alpha = 100;}

       

      if ((dat) >= "12") { block_12._alpha = 50; }

      else { block_12._alpha = 100;}

       

      if ((dat) >= "13") { block_13._alpha = 50; }

      else { block_13._alpha = 100;}

       

      if ((dat) >= "14") { block_14._alpha = 50; }

      else { block_14._alpha = 100;}

       

      if ((dat) >= "15") { block_15._alpha = 50; }

      else { block_15._alpha = 100;}

       

      if ((dat) >= "16") { block_16._alpha = 50; }

      else { block_16._alpha = 100;}

       

      if ((dat) >= "17") { block_17._alpha = 50; }

      else { block_17._alpha = 100;}

       

      if ((dat) >= "18") { block_18._alpha = 50; }

      else { block_18._alpha = 100;}

       

      if ((dat) >= "19") { block_19._alpha = 50; }

      else { block_19._alpha = 100;}

       

      if ((dat) >= "20") { block_20._alpha = 50; }

      else { block_20._alpha = 100;}

       

      if ((dat) >= "21") { block_21._alpha = 50; }

      else { block_21._alpha = 100;}

       

      if ((dat) >= "22") { block_22._alpha = 50; }

      else { block_22._alpha = 100;}

       

      if ((dat) >= "23") { block_23._alpha = 50; }

      else { block_23._alpha = 100;}

       

      if ((dat) >= "24") { block_24._alpha = 50; }

      else { block_24._alpha = 100;}

       

      Any help would be awesome.. cheers all

       

      B