0 Replies Latest reply on Jul 22, 2008 4:37 AM by LukeBrisbane

    for loops

    LukeBrisbane
      Hi Guys, i'm having trouble getting the right syntax. Any help would be appreciated.

      This is the original button code:

      startbtn0.onRelease = function () {

      holder0.loadMovie (currentPic0[count0]);
      desc_txt0.text = descripts0[desc0];
      new Tween (pix0, "_alpha", Strong.easeOut, 0, 100, 3, true);

      };

      I have a number of buttons with the same features relative to each button. I want to put it in a for loop.
      This is what i have so far

      for (i = 0; i < 10; i++) {
      this["startbtn"i].onRelease = function () {

      // dont know what to do with this part after the .loadMovie (....
      this["holder"i].loadMovie (currentPic0[count0]);

      //-- or this either
      this["desc_txt"i].text = descripts0[desc0];

      //again, not sure about the pix0, can this just be this["pix"i] ??
      new Tween (pix0, "_alpha", Strong.easeOut, 0, 100, 3, true);
      };

      }

      So basically, it's the loadMovie and .text parts i'm not sure about. Any help would be appreciated.