Packagegraphics.drawing
Classpublic dynamic class PolyLinePen
InheritancePolyLinePen Inheritance Pen Inheritance flash.utils.Proxy

The PolyLine pen is used to draw a complex shape with differents points (Vector2) in a data model.

Example :

     import flash.geom.Point ;
     
     import graphics.FillStyle ;
     import graphics.drawing.PolyLinePen ;
     import graphics.geom.Vector2 ;
     
     stage.align     = "tl" ;
     stage.scaleMode = "noScale" ;
     
     var shape:Shape = new Shape() ;
     shape.x = 0 ;
     shape.y = 0 ;
     
     addChild( shape ) ;
     var data:Array =
     [
         new Vector2(10,10), new Vector2(110,10), new Point(110,110), {x:10,y:110}
     ] ;
     
     var pen:PolyLinePen = new PolyLinePen( shape , data ) ;
     pen.fill            = new FillStyle( 0xFF0000 ) ;
     pen.draw() ;
     



Public Properties
 PropertyDefined By
 Inheritedalign : uint
Determinates the align value of the pen.
Pen
  data : Array
Determinates the array representation of all points of this polyline pen.
PolyLinePen
 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
 Inheritedline : ILineStyle
Determinates the line style object of the pen.
Pen
 InheriteduseClear : Boolean = true
Indicates if the clear() method is invoked at the end of the draw method.
Pen
  useClose : Boolean = true
Indicates if the polyline is automatically closed.
PolyLinePen
 InheriteduseEndFill : Boolean = true
Indicates if the endFill() method is invoked at the end of the draw method.
Pen
  useFirst : Boolean = true
Indicates if first point in the data model is the first offset position, the x and y value of this pen change and use the value of this point.
PolyLinePen
  x : Number
Defines the x position of the shape rectangle.
PolyLinePen
  y : Number
Defines the y position of the shape rectangle.
PolyLinePen
Public Methods
 MethodDefined By
  
PolyLinePen(graphic:*, data:Array = null)
Creates a new PolyLinePen instance.
PolyLinePen
 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
  
draw(... args):void
[override] Draws the shape.
PolyLinePen
  
drawShape():void
[override] This method contains the basic drawing shape algorithm.
PolyLinePen
 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
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
  
size():Number
Returns the number of elements in the model.
PolyLinePen
Property Detail
dataproperty
data:Array

Determinates the array representation of all points of this polyline pen.

This Array can contains graphics.geom.Vector2, flash.geom.Point or all objects with a numeric x an y properties.


Implementation
    public function get data():Array
    public function set data(value:Array):void
useCloseproperty 
public var useClose:Boolean = true

Indicates if the polyline is automatically closed.

useFirstproperty 
public var useFirst:Boolean = true

Indicates if first point in the data model is the first offset position, the x and y value of this pen change and use the value of this point.

xproperty 
public var x:Number

Defines the x position of the shape rectangle.

yproperty 
public var y:Number

Defines the y position of the shape rectangle.

Constructor Detail
PolyLinePen()Constructor
public function PolyLinePen(graphic:*, data:Array = null)

Creates a new PolyLinePen instance.

Parameters
graphic:* — The Graphics reference to control with this helper. You can passed-in a Shape or Sprite/MovieClip reference in argument.
 
data:Array (default = null) — The array representation of the model of this polyline
Method Detail
draw()method
override public function draw(... args):void

Draws the shape.

Parameters

... args — The array representation of all vectors or points to draw the shape.

drawShape()method 
override public function drawShape():void

This method contains the basic drawing shape algorithm.

size()method 
public function size():Number

Returns the number of elements in the model.

Returns
Number — the number of elements in the model.