Packagemx.graphics
Classpublic class LinearGradientStroke
InheritanceLinearGradientStroke Inheritance GradientBase Inheritance EventDispatcher Inheritance Object
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
A value from the CapsStyle class that specifies the type of caps at the end of lines.
LinearGradientStroke
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedentries : Array
An Array of GradientEntry objects defining the fill patterns for the gradient fill.
GradientBase
  interpolationMethod : String
A value from the InterpolationMethod class that specifies which interpolation method to use.
LinearGradientStroke
  joints : String
A value from the JointStyle class that specifies the type of joint appearance used at angles.
LinearGradientStroke
  miterLimit : Number
A number that indicates the limit at which a miter is cut off.
LinearGradientStroke
  pixelHinting : Boolean
A Boolean value that specifies whether to hint strokes to full pixels.
LinearGradientStroke
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  scaleMode : String
A value from the LineScaleMode class that specifies which scale mode to use.
LinearGradientStroke
  spreadMethod : String
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
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
  
Applies the properties to the specified Graphics object.
LinearGradientStroke
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
Property Detail
angleproperty
angle:Number

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.0 causes the transition to occur from right to left, rather than from left to right.

The default value is 0.0.



Implementation
    public function get angle():Number
    public function set angle(value:Number):void
capsproperty 
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. A null value is equivalent to CapsStyle.ROUND.

The default value is null.

This property can be used as the source for data binding. When this property is modified, it dispatches the propertyChange event.



Implementation
    public function get caps():String
    public function set caps(value:String):void
interpolationMethodproperty 
interpolationMethod:String

A value from the InterpolationMethod class that specifies which interpolation method to use.

Valid values are InterpolationMethod.LINEAR_RGB and InterpolationMethod.RGB.

The default value is InterpolationMethod.RGB.



Implementation
    public function get interpolationMethod():String
    public function set interpolationMethod(value:String):void
jointsproperty 
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. A null value is equivalent to JoinStyle.ROUND.

The default value is null.

This property can be used as the source for data binding. When this property is modified, it dispatches the propertyChange event.



Implementation
    public function get joints():String
    public function set joints(value:String):void
miterLimitproperty 
miterLimit:Number

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 JointStyle.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.

This property can be used as the source for data binding. When this property is modified, it dispatches the propertyChange event.



Implementation
    public function get miterLimit():Number
    public function set miterLimit(value:Number):void
pixelHintingproperty 
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 and AIR hint line widths to full pixel widths. With pixelHinting set to false, disjoints can appear for curves and straight lines.

The default value is false.

This property can be used as the source for data binding. When this property is modified, it dispatches the propertyChange event.



Implementation
    public function get pixelHinting():Boolean
    public function set pixelHinting(value:Boolean):void
scaleModeproperty 
scaleMode:String

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

The default value is LineScaleMode.NORMAL.

This property can be used as the source for data binding. When this property is modified, it dispatches the propertyChange event.



Implementation
    public function get scaleMode():String
    public function set scaleMode(value:String):void
spreadMethodproperty 
spreadMethod:String

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.

This property can be used as the source for data binding. When this property is modified, it dispatches the propertyChange event.



Implementation
    public function get spreadMethod():String
    public function set spreadMethod(value:String):void
weightproperty 
weight:Number

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

This property can be used as the source for data binding. When this property is modified, it dispatches the propertyChange event.



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. This parameter is optional, with a default value of 0.
 
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 and AIR hint line widths to full pixel widths. With pixelHinting set to false, disjoints can appear for curves and straight lines. This parameter is optional, with a default value of false.
 
scaleMode:String (default = "normal") — A value from the LineScaleMode class that specifies which scale mode to use. Valid values are LineScaleMode.HORIZONTAL, LineScaleMode.NONE, LineScaleMode.NORMAL, and LineScaleMode.VERTICAL. This parameter is optional, with a default value of LineScaleMode.NORMAL.
 
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. A null value is equivalent to CapsStyle.ROUND. This parameter is optional, with a default value of null.
 
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. A null value is equivalent to JoinStyle.ROUND. This parameter is optional, with a default value of null.
 
miterLimit:Number (default = 0) — 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. This parameter is optional, with a default value of 0.
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.