I am working on Drawing API. There is a movieclip on stage which I am animating using Tween class. I just want to draw a line from the initial position of a the movieclip to it’s final position. I can draw line, but I can see the lines being duplicated each time the enterframe runs. I just want a single line do be drawn from the movieclip’s initial position to it’s final position.
Here is my code
import mx.transitions.Tween;
import mx.transitions.easing.*;
var myTween:Tween = new Tween(circ0_mc, "_x", Strong.easeOut, circ0_mc._x, 0, 2, true);
var myTween:Tween = new Tween(circ0_mc, "_y", Strong.easeOut, circ0_mc._y, 300, 2, true);
_root.createEmptyMovieClip("circle",1);
this.onEnterFrame = function() {
with (_root.circle) {
lineStyle(4,0x0000FF,100);
moveTo(20,20);
lineTo(circ0_mc._x,circ0_mc._y);
}
}