1 Reply Latest reply on Jun 21, 2009 7:49 AM by kglad

    Simple Actionscript Looping Problem

    chester709

       

      I want to use a loop to generate a number of boxes.  The following code is the test loop code - set to loop just once at this stage.  The problem is that it doesn't seem to like my [i] substitutions in the 'clickBox_inst[i]'.  If I replace '[i]' with 1 it works.  I've looked at lots of example code and can't see the syntax error I must be making (it's the first look I've tried to write).  Anyone any ideas? Many thanks

       

      for (var i = 1; i < 2; i++) { 

       

       

      clickBox_inst.duplicateMovieClip(["clickBox_inst"+i], 1);

      clickBox_inst[i]._x = topLeft_x + outLineWidth;

      clickBox_inst[i]._y = topLeft_y + outLineWidth;

      clickBox_inst[i]._height = iconSize;

      clickBox_inst[i]._width = iconSize;

       

      };