PDA

View Full Version : Drawing a line in a function, but not solid



ditti
May 16th, 2005, 10:34 PM
I have in a function a line to be drawn. I want the line to be not solid but
like this ------. Can I code for that.
line4.lineStyle(2,"0000FF",100);

Lindquist
May 17th, 2005, 02:11 AM
You'll have to fake it...

var numOfDashes:Number = 25;
var dashLength:Number = 5;
var origX:Number = 100;
var origY:Number = 100;

createEmptyMovieClip("line", getNextHighestDepth());

line.lineStyle(1,0xff00ff, 100);
for(i=0;i<numOfDashes;i++){
line.moveTo(origX+dashLength*(i*2), origY+dashLength*(i*2));
line.lineTo(origX+dashLength*(i*2+1), origY+dashLength*(i*2+1));
}

-L

ditti
May 18th, 2005, 08:45 AM
Thank you, I canīt use this on my line cause lines are drawing dynamically to points when you drag and drop points, but I will use this in another movie. I donīt know the width of the lines.

senocular
May 18th, 2005, 08:55 AM
why cant you use that again?

ditti
May 18th, 2005, 01:42 PM
I attach my fla. I want the height to be a dashed line, but with the code I got from Lindquist (http://www.kirupa.com/forum/member.php?u=29225) vbmenu_register("postmenu_840418", true); this canīt be done, am I right?