PDA

View Full Version : clear() function



mario_hater
January 14th, 2007, 12:25 PM
im trying to draw a line to a ball that i create but it just keeps making new lines. I though i saw a way to stop that putting a clear() in. this is my code


lineStyle(1);
attachMovie("ball", "ball", 0);
onEnterFrame = function () {
moveTo(ball._x, ball._y);
lineTo(_xmouse, _ymouse);
};

bombsledder
January 14th, 2007, 12:36 PM
you mean like this



lineStyle(1);
attachMovie("ball", "ball", 0);
onEnterFrame = function () {
this.clear()
this.moveTo(ball._x, ball._y);
this.lineTo(_xmouse, _ymouse);
};

mario_hater
January 14th, 2007, 12:49 PM
thanks