There were a couple requests about using lineTo in order to draw a following line (like the old 45deg line trick)
http://perfectweb.org/Simple_Drag_Follow.html
http://perfectweb.org/Simple_Drag_Follow.fla
The code is really simple:
Code:
ball_mc.onMouseDown = function()
{
if (hitTest(_root._xmouse, _root._ymouse))
{
startDrag(this, true);
dragged = true;
}
}
ball_mc.onMouseUp = function()
{
if (dragged)
{
dragged = false;
stopDrag();
}
}
ball_mc.onEnterFrame = function()
{
if (dragged)
{
_root.clear();
_root.lineStyle(5, 0x0000FF, 100);
_root.moveTo(275, 200);
_root.lineTo(ball_mc._x, ball_mc._y);
}
}
That's it,
Spyder