# Dotted curve line with script

**URL:** <https://forum.kirupa.com/t/dotted-curve-line-with-script/46740>\
**Category:** Uncategorized\
**Created:** [March 27, 2004, 11:20am UTC](https://forum.kirupa.com/t/dotted-curve-line-with-script/46740 "2004-03-27T11:20:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pallothu\_ashok](https://avatars.discourse-cdn.com/v4/letter/p/f0a364/32.png) [@pallothu\_ashok](https://forum.kirupa.com/u/pallothu_ashok)\
**Post date:** [March 27, 2004, 11:20am UTC](https://forum.kirupa.com/t/dotted-curve-line-with-script/46740/1 "2004-03-27T11:20:25Z")

</div>

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);  
}
