I’ve got a movie with four draggable MC’s - they represent four points on a line chart and only move vertically (named D, I, S, C). To improve the realism of the chart I need to dynamically draw lines between each point.
Inside each symbol on the stage is a button, the actions for each button ar similiar to:
on (press) {
startDrag("d_slider", false, 0, -198, 0, 198);
}
on (release, releaseOutside) {
stopDrag();
_root.d_var.text = int(((Number(((d_slider._y/396)*(8-(-8)))) + Number(0)) * -1)*100)/100;
}
In the _root of the I’m using (this one draws a line from D to I):
_root.createEmptyMovieClip("line_mc", 1);
MovieClip.prototype.drawLine = function()
{
line_mc.clear();
line_mc.lineStyle(1,0xFF0000,100);
line_mc.moveTo(D._x, D._y);
line_mc.lineTo(I._x, I._y);
}
line_mc.drawLine();
But how can I get it to follow and redraw the line each time one of the MC’s is moved? If I put another startDrag in it will screw up the initial drag code I have above… Can anyone see a way to integrate these or any help would be greatly appreciated.
Thanks,
Aaron