I know, its sad; having trouble drawing lines. Anyway, I have two movieclips that travel around the stage, and my goal is to draw the triangle the vectors form dynamically. However, when I draw these lines, they keep drawing over and over, and I want the lines to be redrawn each frame…clearing the old line.
When I use the clear(); function, no lines show up at all…here’s my code, any help?
drawLines = function() {
_root.createEmptyMovieClip("aLine",3);
_root.createEmptyMovieClip("bLine",4);
_root.createEmptyMovieClip("cLine",5);
aLine.lineStyle(2,0xFF0000,100);
bLine.lineStyle(2,0x0000FF,100);
cLine.lineStyle(2,0xFFFF00,100);
this.onEnterFrame = function() {
aLine.moveTo(ball1._x,ball1._y);
aLine.lineTo(ball2._x,ball1._y);
Line.moveTo(ball2._x,ball2._y);
bLine.lineTo(ball2._x,ball1._y);
cLine.moveTo(ball1._x,ball1._y);
cLine.lineTo(ball2._x,ball2._y);
aLine.clear();
bLine.clear();
cLine.clear();
}
}
This is the code for just the function which draws the lines.