Packagesekati.draw
Classpublic class Line
InheritanceLine Inheritance flash.display.Shape
ImplementsITweenableDrawing

Line provides a Tweenable line Shape.



Public Properties
 PropertyDefined by
  color : uint
Return the color.
Line
  ex : Number
Return the end x pos.
Line
  ey : Number
Return the end y pos.
Line
  sx : Number
Return the start x pos.
Line
  sy : Number
Return the start y pos.
Line
  thickness : uint
Return the thickness.
Line
Protected Properties
 PropertyDefined by
  _alpha : Number
Line
  _caps : String
Line
  _color : uint
Line
  _ex : Number
Line
  _ey : Number
Line
  _joints : String
Line
  _miterLimit : Number
Line
  _pixelHinting : Boolean
Line
  _scaleMode : String
Line
  _sx : Number
Line
  _sy : Number
Line
  _thickness : Number
Line
Public Methods
 MethodDefined by
  
Line(startX:Number, startY:Number, endX:Number, endY:Number, thickness:Number, color:uint, alpha:Number, pixelHinting:Boolean, scaleMode:String, caps:String = null, joints:String, miterLimit:Number)
Line Constructor
Line
  
clear():void
Clear the drawn graphics Shape.
Line
  
draw():void
Draw in to the graphics Shape.
Line
  
redraw():void
Clear & draw in to the graphics Shape.
Line
Public Constants
 ConstantDefined by
  ALPHA : Number = 1
[static]
Line
  CAPS : String = "square"
[static]
Line
  COLOR : uint = 0x000000
[static]
Line
  HINTING : Boolean = true
[static]
Line
  JOINTS : String = "miter"
[static]
Line
  MITER_LIMIT : Number = 3
[static]
Line
  SCALE_MODE : String = "none"
[static]
Line
  THICKNESS : Number = 1
[static] I know this is BS but compiler bug in mxmlc prevents proper compilation.
Line
Property detail
_alphaproperty
protected var _alpha:Number
_capsproperty 
protected var _caps:String
_colorproperty 
protected var _color:uint
colorproperty 
color:uint  [read-write]

Return the color.

Implementation
    public function get color():uint
    public function set color(value:uint):void
_exproperty 
protected var _ex:Number
exproperty 
ex:Number  [read-write]

Return the end x pos.

Implementation
    public function get ex():Number
    public function set ex(value:Number):void
_eyproperty 
protected var _ey:Number
eyproperty 
ey:Number  [read-write]

Return the end y pos.

Implementation
    public function get ey():Number
    public function set ey(value:Number):void
_jointsproperty 
protected var _joints:String
_miterLimitproperty 
protected var _miterLimit:Number
_pixelHintingproperty 
protected var _pixelHinting:Boolean
_scaleModeproperty 
protected var _scaleMode:String
_sxproperty 
protected var _sx:Number
sxproperty 
sx:Number  [read-write]

Return the start x pos.

Implementation
    public function get sx():Number
    public function set sx(value:Number):void
_syproperty 
protected var _sy:Number
syproperty 
sy:Number  [read-write]

Return the start y pos.

Implementation
    public function get sy():Number
    public function set sy(value:Number):void
_thicknessproperty 
protected var _thickness:Number
thicknessproperty 
thickness:uint  [read-write]

Return the thickness.

Implementation
    public function get thickness():uint
    public function set thickness(value:uint):void
Constructor detail
Line()constructor
public function Line(startX:Number, startY:Number, endX:Number, endY:Number, thickness:Number, color:uint, alpha:Number, pixelHinting:Boolean, scaleMode:String, caps:String = null, joints:String, miterLimit:Number)

Line Constructor

Parameters
startX:Number
 
startY:Number
 
endX:Number
 
endY:Number
 
thickness:Number
 
color:uint
 
alpha:Number
 
pixelHinting:Boolean
 
scaleMode:String
 
caps:String (default = null)
 
joints:String
 
miterLimit:Number

Example
   var line:Line = new Line(0, 0, 100, 100, 1, 0xff00ff);
   
   addChild(line);
   
   Tweener.addTween(line, {sx:50, sy:350, ex:700, ey:350, color:0xffff00, time:5, transition:"easeInOutQuart", onUpdate:renderLine});
   Tweener.addTween(line, {sx:850, sy:50, ex:950, ey:0, color:0xffffff, time:5, delay:5, transition:"easeInQuart", onUpdate:renderLine});
   
   function renderLine():void {
    line.draw();   // add to the existing drawing
    //line.redraw();  // clear the drawing and redraw
   }
   

Method detail
clear()method
public function clear():void

Clear the drawn graphics Shape.

draw()method 
public function draw():void

Draw in to the graphics Shape.

redraw()method 
public function redraw():void

Clear & draw in to the graphics Shape.

Constant detail
ALPHAconstant
public static const ALPHA:Number = 1
CAPSconstant 
public static const CAPS:String = "square"
COLORconstant 
public static const COLOR:uint = 0x000000
HINTINGconstant 
public static const HINTING:Boolean = true
JOINTSconstant 
public static const JOINTS:String = "miter"
MITER_LIMITconstant 
public static const MITER_LIMIT:Number = 3
SCALE_MODEconstant 
public static const SCALE_MODE:String = "none"
THICKNESSconstant 
public static const THICKNESS:Number = 1

I know this is BS but compiler bug in mxmlc prevents proper compilation.

See also