hi
check my attachment dot_curveline_drawing.zip
i need flash program to draw curve dotted line between Starting point to end point coordinate · as in my attachment dot_curveline_drawing.zip
kindly edit the featured code to meet my requirement .help would be appreciated
sample code for dotted line
// This prototype Uses Flash MX’s drawing API to draw a
// straight dotted (or dashed) line between 2 points
// Thanks to Tyard for a great starting point
MovieClip.prototype.dashTo = function(startPoint, destPoint, dashLength, spaceLength) {
var x = destPoint.x - startPoint.x;
var y = destPoint.y - startPoint.y;
var hyp = Math.sqrt((x)(x) + (y)(y));
var units = hyp/(dashLength+spaceLength);
var dashSpaceRatio = dashLength/(dashLength+spaceLength);
var dashX = (x/units)*dashSpaceRatio;
var spaceX = (x/units)-dashX;
var dashY = (y/units)*dashSpaceRatio;
var spaceY = (y/units)-dashY;
this.moveTo(startPoint.x, startPoint.y);
while (hyp > 0) {
startPoint.x += dashX;
startPoint.y += dashY;
hyp -= dashLength;
if (hyp < 0) {
startPoint.x = destPoint.x;
startPoint.y = destPoint.y;
}
this.lineTo(startPoint.x, startPoint.y);
startPoint.x += spaceX;
startPoint.y += spaceY;
this.moveTo(startPoint.x, startPoint.y);
hyp -= spaceLength;
}
this.moveTo(destPoint.x, destPoint.y);
}
//
// You use it like this:
createEmptyMovieClip (“DrawingSpace”, 1);
with (DrawingSpace) {
lineStyle (0, 0x000000, 100);
dashTo({x:300, y:0}, {x:0, y:400}, 3, 10);
}