# lineTo() coordinates from array?

**URL:** <https://forum.kirupa.com/t/lineto-coordinates-from-array/221214>\
**Category:** flash\
**Created:** [April 2, 2007, 4:28pm UTC](https://forum.kirupa.com/t/lineto-coordinates-from-array/221214 "2007-04-02T16:28:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![project107](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@project107](https://forum.kirupa.com/u/project107)\
**Post date:** [April 2, 2007, 4:28pm UTC](https://forum.kirupa.com/t/lineto-coordinates-from-array/221214/1 "2007-04-02T16:28:48Z")

</div>

How?  
I currently have this:

```auto

// create new array for coordinates
// x = time
xcord = new Array("20","40","50","80","120","150");
// y = slider location
ycord = new Array("21","56","87","90","43","200");
//
xcordLength = xcord.length;
ycordLength = ycord.length;
// create empty MC to draw the API line
this.createEmptyMovieClip("graph_mc", 0);
with (graph_mc) {
    //thickness, color, alpha
    lineStyle(1, 0x006699, 50);
    //initial positions - x,y
    moveTo(0, 150);
    // draw the line to
    lineTo(xcord[0], ycord[0]);
    lineTo(xcord[1], ycord[1]);
    lineTo(xcord[2], ycord[2]);
    lineTo(xcord[3], ycord[3]);
    lineTo(xcord[4], ycord[4]);
     
}
// monitor the array length
trace(xcordLength+","+ycordLength);

```

So, how do I invoke the lineTo as many times as I have array items, and for each time, go to the next item in the array as to make a line graph? Thanks!
