Packagegraphics
Classpublic class LineStyle
InheritanceLineStyle Inheritance Object
Implements ILineStyle

Defines the line style of the vector shapes. See the flash.display.graphics.lineStyle method.



Public Properties
 PropertyDefined By
  alpha : Number
A number that indicates the alpha value of the color of the line; valid values are 0 to 1.
LineStyle
  caps : String
A value from the CapsStyle class that specifies the type of caps at the end of lines.
LineStyle
  color : uint
A hexadecimal color value of the line; for example, red is 0xFF0000, blue is 0x0000FF, and so on.
LineStyle
  joints : String
A value from the JointStyle class that specifies the type of joint appearance used at angles.
LineStyle
  miterLimit : Number
A number that indicates the limit at which a miter is cut off.
LineStyle
  pixelHinting : Boolean
A Boolean value that specifies whether to hint strokes to full pixels.
LineStyle
  scaleMode : String
A value from the LineScaleMode class that specifies which scale mode to use : LineScaleMode.NORMAL—Always scale the line thickness when the object is scaled (the default). LineScaleMode.NONE—Never scale the line thickness.
LineStyle
  thickness : Number
An integer that indicates the thickness of the line in points ; valid values are 0 to 255.
LineStyle
Public Methods
 MethodDefined By
  
LineStyle(thickness:Number, color:uint = 0, alpha:Number = 1.0, pixelHinting:Boolean = false, scaleMode:String = normal, caps:String = null, joints:String = null, miterLimit:Number = 3)
Creates a new LineStyle instance.
LineStyle
  
apply(graphic:Graphics):void
Initialize the line settings of the specified Graphics reference.
LineStyle
  
clone():*
Creates and returns a shallow copy of the object.
LineStyle
  
equals(o:*):Boolean
Compares the specified object with this object for equality.
LineStyle
  
toSource(indent:int = 0):String
Returns the source code string representation of the object.
LineStyle
Public Constants
 ConstantDefined By
  EMPTY : LineStyle
[static] The empty LineStyle singleton.
LineStyle
Property Detail
alphaproperty
public var alpha:Number

A number that indicates the alpha value of the color of the line; valid values are 0 to 1. If a value is not indicated, the default is 1 (solid). If the value is less than 0, the default is 0. If the value is greater than 1, the default is 1.

capsproperty 
public var caps:String

A value from the CapsStyle class that specifies the type of caps at the end of lines. Valid values are : CapsStyle.NONE, CapsStyle.ROUND, and CapsStyle.SQUARE. If a value is not indicated, Flash uses round caps.

colorproperty 
public var color:uint

A hexadecimal color value of the line; for example, red is 0xFF0000, blue is 0x0000FF, and so on. If a value is not indicated, the default is 0x000000 (black).

jointsproperty 
public var joints:String

A value from the JointStyle class that specifies the type of joint appearance used at angles. Valid values are: JointStyle.BEVEL, JointStyle.MITER, and JointStyle.ROUND. If a value is not indicated, Flash uses round joints.

miterLimitproperty 
public var miterLimit:Number

A number that indicates the limit at which a miter is cut off. Valid values range from 1 to 255 (and values outside of that range are rounded to 1 or 255). This value is only used if the jointStyle is set to "miter". The miterLimit value represents the length that a miter can extend beyond the point at which the lines meet to form a joint. The value expresses a factor of the line thickness. For example, with a miterLimit factor of 2.5 and a thickness of 10 pixels, the miter is cut off at 25 pixels.

pixelHintingproperty 
public var pixelHinting:Boolean

A Boolean value that specifies whether to hint strokes to full pixels. This affects both the position of anchors of a curve and the line stroke size itself. With pixelHinting set to true, Flash Player hints line widths to full pixel widths. With pixelHinting set to false, disjoints can appear for curves and straight lines.

scaleModeproperty 
public var scaleMode:String

A value from the LineScaleMode class that specifies which scale mode to use :

  • LineScaleMode.NORMAL—Always scale the line thickness when the object is scaled (the default).
  • LineScaleMode.NONE—Never scale the line thickness.
  • thicknessproperty 
    public var thickness:Number

    An integer that indicates the thickness of the line in points ; valid values are 0 to 255. If a number is not specified, or if the parameter is undefined, a line is not drawn. If a value of less than 0 is passed, the default is 0. The value 0 indicates hairline thickness ; the maximum thickness is 255. If a value greater than 255 is passed, the default is 255.

    Constructor Detail
    LineStyle()Constructor
    public function LineStyle(thickness:Number, color:uint = 0, alpha:Number = 1.0, pixelHinting:Boolean = false, scaleMode:String = normal, caps:String = null, joints:String = null, miterLimit:Number = 3)

    Creates a new LineStyle instance.

    Parameters
    thickness:Number (default = NaN) — An integer that indicates the thickness of the line in points; valid values are 0 to 255. If a number is not specified, or if the parameter is NaN, a line is not drawn. If a value of less than 0 is passed, the default is 0. The value 0 indicates hairline thickness; the maximum thickness is 255. If a value greater than 255 is passed, the default is 255.
     
    color:uint (default = 0) — (default = 0) A hexadecimal color value of the line; for example, red is 0xFF0000, blue is 0x0000FF, and so on. If a value is not indicated, the default is 0x000000 (black). Optional.
     
    alpha:Number (default = 1.0) — (default = 1.0) A number that indicates the alpha value of the color of the line; valid values are 0 to 1. If a value is not indicated, the default is 1 (solid). If the value is less than 0, the default is 0. If the value is greater than 1, the default is 1.
     
    pixelHinting:Boolean (default = false) — (default = false) A Boolean value that specifies whether to hint strokes to full pixels. This affects both the position of anchors of a curve and the line stroke size itself. With pixelHinting set to true, Flash Player hints line widths to full pixel widths. With pixelHinting set to false, disjoints can appear for curves and straight lines.
     
    scaleMode:String (default = normal) — (default = "normal") A value from the LineScaleMode class that specifies which scale mode to use :
  • LineScaleMode.NORMAL—Always scale the line thickness when the object is scaled (the default).
  • LineScaleMode.NONE—Never scale the line thickness.
  • LineScaleMode.VERTICAL—Do not scale the line thickness if the object is scaled vertically only.
  •  
    caps:String (default = null) — (default = null) — A value from the CapsStyle class that specifies the type of caps at the end of lines. Valid values are: CapsStyle.NONE, CapsStyle.ROUND, and CapsStyle.SQUARE. If a value is not indicated, Flash uses round caps.
     
    joints:String (default = null) — (default = null) — A value from the JointStyle class that specifies the type of joint appearance used at angles. Valid values are: JointStyle.BEVEL, JointStyle.MITER, and JointStyle.ROUND. If a value is not indicated, Flash uses round joints.
     
    miterLimit:Number (default = 3) — (default = 3) — A number that indicates the limit at which a miter is cut off. Valid values range from 1 to 255 (and values outside of that range are rounded to 1 or 255). This value is only used if the jointStyle is set to "miter". The miterLimit value represents the length that a miter can extend beyond the point at which the lines meet to form a joint. The value expresses a factor of the line thickness. For example, with a miterLimit factor of 2.5 and a thickness of 10 pixels, the miter is cut off at 25 pixels.
    Method Detail
    apply()method
    public function apply(graphic:Graphics):void

    Initialize the line settings of the specified Graphics reference.

    Parameters

    graphic:Graphics

    clone()method 
    public function clone():*

    Creates and returns a shallow copy of the object.

    Returns
    * — A new object that is a shallow copy of this instance.
    equals()method 
    public function equals(o:*):Boolean

    Compares the specified object with this object for equality.

    Parameters

    o:*

    Returns
    Booleantrue if the the specified object is equal with this object.
    toSource()method 
    public function toSource(indent:int = 0):String

    Returns the source code string representation of the object.

    Parameters

    indent:int (default = 0)

    Returns
    String — the source code string representation of the object.
    Constant Detail
    EMPTYConstant
    public static const EMPTY:LineStyle

    The empty LineStyle singleton.