6 Replies Latest reply on Jul 21, 2006 10:53 AM by FlashForumName

    dynammically creating MC's for lineto

    FlashForumName Level 1
      Hi all. I've read in some data from an xml file that contains various x and y coordinates. I need to now draw lines between them all. I understand how to draw A line ie:

      _root.createEmptyMovieClip("triangle_mc", 1);
      triangle_mc.moveTo(182, 508);
      triangle_mc.lineStyle(1, 0xFF00FF, 100);
      triangle_mc.lineTo(values[xaxis], values[ i ]);

      Which works just fine. The problem is, I do not know how many lines I will need. I tried doing some sort of naming standard such as this:

      temp = "lineName"+count
      _root.createEmptyMovieClip(temp, 1)
      count++
      temp.moveTo(182, 508);
      temp.lineStyle(1, 0xFF00FF, 100);
      temp.lineTo(values[xaxis], values[ i ]);

      but to no avail. Perhaps I am missing something obvious here. Could anyone point me in the right direction or perhaps a better way to do this? Thanks in advance!