Packagegraphics.drawing
Classpublic dynamic class DashLinePen
InheritanceDashLinePen Inheritance LinePen Inheritance Pen Inheritance flash.utils.Proxy

This pen is the basic tool to draw a dash line.

Example :

     import flash.display.StageScaleMode ;
     
     import graphics.LineStyle ;
     
     import graphics.drawing.DashLinePen ;
     
     import graphics.geom.Vector2 ;
     
     stage.scaleMode = StageScaleMode.NO_SCALE ;
     stage.align     = "" ;
     
     var shape:Shape = new Shape() ;
     
     shape.x = 10 ;
     shape.y = 10 ;
     
     var start:Vector2 = new Vector2(0,0) ;
     var end:Vector2   = new Vector2(100, 100) ;
     
     var pen:DashLinePen = new DashLinePen( shape , start , end , 4, 6) ;
     pen.line            = new LineStyle( 2, 0xFFFFFF , 1 , true ) ;
     pen.draw() ;
     
     addChild( shape ) ;
     



Public Properties
 PropertyDefined By
 Inheritedalign : uint
Determinates the align value of the pen.
Pen
  DEFAULT_LENGTH : Number = 2
[static] The default length value of the dashs in the line.
DashLinePen
  DEFAULT_SPACING : Number = 2
[static] The default spacing value of the dashs in the line.
DashLinePen
 Inheritedend : Vector2
The end vector object of this line pen.
LinePen
 Inheritedfill : IFillStyle
Determinates the fill style object of the pen.
Pen
 Inheritedgraphics : *
Specifies the Graphics object belonging to this Shape object, where vector drawing commands can occur.
Pen
  length : Number
(read-write) Determinates the length of a dash in the line.
DashLinePen
 Inheritedline : ILineStyle
Determinates the line style object of the pen.
Pen
  spacing : Number
Determinates the spacing value between two dashs in this line.
DashLinePen
 Inheritedstart : Vector2
The start vector object of this line pen.
LinePen
 InheriteduseClear : Boolean = true
Indicates if the clear() method is invoked at the end of the draw method.
Pen
 InheriteduseEndFill : Boolean = true
Indicates if the endFill() method is invoked at the end of the draw method.
Pen
Public Methods
 MethodDefined By
  
DashLinePen(graphic:*, start:* = null, end:* = null, length:Number = 2, spacing:Number = 2)
Creates a new DashLinePen instance.
DashLinePen
 Inherited
BF(... arguments):void
Defines a shortcut reference to used the beginBitmapFill method.
Pen
 Inherited
C(... arguments):void
Defines a shortcut reference to used the curveTo method.
Pen
 Inherited
CL():void
Defines a shortcut reference to used the clear method.
Pen
 Inherited
draw(... args):void
[override] Draws the shape.
LinePen
  
drawShape():void
[override] This method contains the basic drawing shape algorithm.
DashLinePen
 Inherited
EF():void
Defines a shortcut reference to used the endFill method.
Pen
 Inherited
F(... arguments):void
Defines a shortcut reference to used the beginFill method.
Pen
 Inherited
Returns the Line reference of this pen.
LinePen
 Inherited
GF(... arguments):void
Defines a shortcut reference to used the beginGradientFill method.
Pen
 Inherited
GS(... arguments):void
Defines a shortcut reference to used the lineGradientStyle method.
Pen
 Inherited
L(... arguments):void
Defines a shortcut reference to used the lineTo method.
Pen
 Inherited
M(... arguments):void
Defines a shortcut reference to used the moveTo method.
Pen
 Inherited
S(... arguments):void
Defines a shortcut reference to used the lineStyle method.
Pen
  
setPen(... args):void
[override] Sets the arc options to defined all values to draw the arc shape in the movieclip reference of this pen.
DashLinePen
Property Detail
DEFAULT_LENGTHproperty
public static var DEFAULT_LENGTH:Number = 2

The default length value of the dashs in the line.

DEFAULT_SPACINGproperty 
public static var DEFAULT_SPACING:Number = 2

The default spacing value of the dashs in the line.

lengthproperty 
length:Number

(read-write) Determinates the length of a dash in the line.


Implementation
    public function get length():Number
    public function set length(value:Number):void
spacingproperty 
spacing:Number

Determinates the spacing value between two dashs in this line.


Implementation
    public function get spacing():Number
    public function set spacing(value:Number):void
Constructor Detail
DashLinePen()Constructor
public function DashLinePen(graphic:*, start:* = null, end:* = null, length:Number = 2, spacing:Number = 2)

Creates a new DashLinePen instance.

Parameters
graphic:* — The Graphics reference to control with this helper. You can passed-in a Shape or Sprite/MovieClip reference in argument.
 
start:* (default = null) — The vector object to defines the start position of the drawing.
 
end:* (default = null) — The vector object to defines the end position of the drawing.
 
length:Number (default = 2) — The length of the dashs.
 
spacing:Number (default = 2) — The spacing between two dashs.
Method Detail
drawShape()method
override public function drawShape():void

This method contains the basic drawing shape algorithm.

setPen()method 
override public function setPen(... args):void

Sets the arc options to defined all values to draw the arc shape in the movieclip reference of this pen.

Parameters

... args — (optional) The end vector value (flash.geom.Point or graphics.geom.Vector2)