Actionscript draw dynamic lines

Hi i am currently trying to use actionscript to make a flash
program so that when i click once to set a circle and click another
place to set another circle, a line will join these two circles.

If i click to set a 3rd circle then this 3rd circle will line to the 2nd one
and so on…

i have a circle movie clip in my library and the circles are appearing fine.
my code is as follows but no line is appearing between the circles…can anyone help me?

_root.onMouseDown = function() {
var nc = getNextHighestDepth();
this.createEmptyMovieClip(“line”, nc);
nc++;
this.attachMovie(“circle”, “circle”+nc, nc);
this[“circle”+nc]._x = _xmouse;
this[“circle”+nc]._y = _ymouse;
if (nc-2 > 0) {
line.lineStyle(1, 0x000000);
gox=this[“circle”+(nc-2)]._x;
goy=this[“circle”+(nc-2)]._y;
line.moveTo(gox, goy);
line.lineTo(_xmouse, _ymouse);
}
};