Packagemx.graphics
Classpublic class LinearGradientStroke
Implements IStroke

The LinearGradientStroke class lets you specify a gradient filled stroke. You use the LinearGradientStroke class, along with the GradientEntry class, to define a gradient stroke.

See also

mx.graphics.Stroke
mx.graphics.GradientEntry
mx.graphics.RadialGradient
flash.display.Graphics


Public Properties
 PropertyDefined By
  angle : Number
By default, the LinearGradientStroke defines a transition from left to right across the control.
LinearGradientStroke
  caps : String = "null"
A value from the CapsStyle class that specifies the type of caps at the end of lines.
LinearGradientStroke
  interpolationMethod : String = "rgb"
A value from the InterpolationMethod class that specifies which value to use.
LinearGradientStroke
  joints : String = "null"
A value from the JointStyle class that specifies the type of joint appearance used at angles.
LinearGradientStroke
  miterLimit : Number = 0
A number that indicates the limit at which a miter is cut off.
LinearGradientStroke
  pixelHinting : Boolean = false
A Boolean value that specifies whether to hint strokes to full pixels.
LinearGradientStroke
  scaleMode : String = "normal"
A value from the LineScaleMode class that specifies which scale mode to use.
LinearGradientStroke
  spreadMethod : String = "pad"
A value from the SpreadMethod class that specifies which spread method to use.
LinearGradientStroke
  weight : Number
The line weight, in pixels.
LinearGradientStroke
Public Methods
 MethodDefined By
  
LinearGradientStroke(weight:Number = 0, pixelHinting:Boolean = false, scaleMode:String = "normal", caps:String = null, joints:String = null, miterLimit:Number = 0)
Constructor.
LinearGradientStroke
  
Applies the properties to the specified Graphics object.
LinearGradientStroke
Property Detail
angleproperty
angle:Number  [read-write]

By default, the LinearGradientStroke defines a transition from left to right across the control. Use the angle property to control the transition direction. For example, a value of 180 causes the transition to occur from right to left, rather than from left to right.


Implementation
    public function get angle():Number
    public function set angle(value:Number):void
capsproperty 
public var caps:String = "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.

The default value is CapsStyle.ROUND.

interpolationMethodproperty 
public var interpolationMethod:String = "rgb"

A value from the InterpolationMethod class that specifies which value to use. Valid values are InterpolationMethod.LINEAR_RGB and InterpolationMethod.RGB.

The default value is InterpolationMethod.RGB.

jointsproperty 
public var joints:String = "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.

The default value is JointStyle.ROUND.

miterLimitproperty 
public var miterLimit:Number = 0

A number that indicates the limit at which a miter is cut off. Valid values range from 0 to 255 (and values outside of that range are rounded to 0 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.

The default value is 0.

pixelHintingproperty 
public var pixelHinting:Boolean = 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.

The default value is false.

scaleModeproperty 
public var scaleMode:String = "normal"

A value from the LineScaleMode class that specifies which scale mode to use. Value valids are:

spreadMethodproperty 
public var spreadMethod:String = "pad"

A value from the SpreadMethod class that specifies which spread method to use. Value values are SpreadMethod.PAD, SpreadMethod.REFLECT, and SpreadMethod.REPEAT.

The default value is SpreadMethod.PAD.

weightproperty 
weight:Number  [read-write]

The line weight, in pixels. For many chart lines, the default value is 1 pixel.


Implementation
    public function get weight():Number
    public function set weight(value:Number):void
Constructor Detail
LinearGradientStroke()Constructor
public function LinearGradientStroke(weight:Number = 0, pixelHinting:Boolean = false, scaleMode:String = "normal", caps:String = null, joints:String = null, miterLimit:Number = 0)

Constructor.

Parameters
weight:Number (default = 0) — Specifies the line weight, in pixels.
 
pixelHinting:Boolean (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.

If a value is not supplied, the line does not use pixel hinting.

 
scaleMode:String (default = "normal") — A value from the LineScaleMode class that specifies which scale mode to use. Possible values are horizontal, none, normal and vertical.
 
caps:String (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. The default value is CapsStyle.ROUND.
 
joints:String (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. The default value is JoinStyle.ROUND.
 
miterLimit:Number (default = 0) — Optional. 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 property 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(g:Graphics):void

Applies the properties to the specified Graphics object.

Parameters

g:Graphics — The Graphics object to which the LinearGradientStroke styles are applied.





 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/common/langref/mx/graphics/LinearGradientStroke.html