hi folks,
now here is a simple function to make a doted line - try it
"caller": dotIt(this.container.width,100,100,"horizontal");
// paint a doted line
private function dotIt(length:int, startX:int, startY:int, direction:String):void
{
var currentLength:int;
var dotLength:int = 5;
var paintDot:Boolean = true;
length -= dotLength; // no over painting
this.container.graphics.lineStyle(0.5,this.fontColor,0.5);
this.container.graphics.moveTo(startX,startY);
for(currentLength=0; currentLength <= length; currentLength+=dotLength)
{
// paint dot
if(paintDot==true)
{
this.container.graphics.lineStyle(0.5,this.fontColor,0.5);
switch(direction)
{
case "horizontal":
this.container.graphics.lineTo(startX+=dotLength,startY);
break;
case "vertical":
this.container.graphics.lineTo(startX,startY+=dotLength);
break;
}
paintDot=false;
}
// paint space
else
{
this.container.graphics.lineStyle(0,this.fontColor,0);
switch(direction)
{
case "horizontal":
this.container.graphics.lineTo(startX+=dotLength,startY);
break;
case "vertical":
this.container.graphics.lineTo(startX,startY+=dotLength);
break;
}
paintDot=true;
}
}
}
thx4replies ^^