Packagemx.graphics
Classpublic class Stroke
InheritanceStroke Inheritance EventDispatcher Inheritance Object
Implements IStroke

The Stroke class defines the properties for a line. You can define a Stroke object in MXML, but you must attach that Stroke to another object for it to appear in your application. The following example defines two Stroke objects and then uses them in the horizontalAxisRenderer of a LineChart control:
  ...
  <mx:Stroke id="ticks" color="0xFF0000" weight="1"/>
  <mx:Stroke id="mticks" color="0x0000FF" weight="1"/>
  
  <mx:LineChart id="mychart" dataProvider="{ndxa}">
   <mx:horizontalAxisRenderer>
    <mx:AxisRenderer placement="bottom" canDropLabels="true">
     <mx:tickStroke>{ticks}</mx:tickStroke>
     <mx:minorTickStroke>{mticks}</mx:minorTickStroke>
    </mx:AxisRenderer>
   </mx:horizontalAxisRenderer>
  </LineChart>
  ...
  

MXML SyntaxexpandedHide MXML Syntax

The <mx:Stroke> tag inherits all the tag attributes of its superclass, and adds the following tag attributes:

  <mx:Stroke
    Properties
    alpha="1.0"
    caps="null|none|round|square"
    color="0x000000"
    joints="null|bevel|miter|round"
    miterLimit="0"
    pixelHinting="false|true"
    scaleMode="normal|none|noScale|vertical"
    weight="1 (in most cases)"
  />
  

See also

flash.display.Graphics
Using strokes with chart controls


Public Properties
 PropertyDefined By
  alpha : Number
The transparency of a line.
Stroke
  caps : String
Specifies the type of caps at the end of lines.
Stroke
  color : uint
The line color.
Stroke
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  joints : String
Specifies the type of joint appearance used at angles.
Stroke
  miterLimit : Number
Indicates the limit at which a miter is cut off.
Stroke
  pixelHinting : Boolean
Specifies whether to hint strokes to full pixels.
Stroke
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  scaleMode : String
Specifies how to scale a stroke.
Stroke
  weight : Number
The line weight, in pixels.
Stroke
Public Methods
 MethodDefined By
  
Stroke(color:uint = 0x000000, weight:Number = 0, alpha:Number = 1.0, pixelHinting:Boolean = false, scaleMode:String = "normal", caps:String = null, joints:String = null, miterLimit:Number = 0)
Constructor.
Stroke
 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.
Stroke
 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
alphaproperty
alpha:Number

The transparency of a line. Possible values are 0.0 (invisible) through 1.0 (opaque).

The default value is 1.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 alpha():Number
    public function set alpha(value:Number):void
capsproperty 
caps:String

Specifies the type of caps at the end of lines. Valid values are: "round", "square", and "none".

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
colorproperty 
color:uint

The line color.

The default value is 0x000000 (black)..

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 color():uint
    public function set color(value:uint):void
jointsproperty 
joints:String

Specifies the type of joint appearance used at angles. Valid values are "round", "miter", and "bevel".

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

Indicates the limit at which a miter is cut off. Valid values range from 0 to 255.

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

Specifies whether to hint strokes to full pixels. This value affects both the position of anchors of a curve and the line stroke size itself.

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

Specifies how to scale a stroke. Valid values are "normal", "none", "vertical", and "noScale".

The default value is "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
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
Stroke()Constructor
public function Stroke(color:uint = 0x000000, weight:Number = 0, alpha:Number = 1.0, pixelHinting:Boolean = false, scaleMode:String = "normal", caps:String = null, joints:String = null, miterLimit:Number = 0)

Constructor.

Parameters
color:uint (default = 0x000000) — Specifies the line color. The default value is 0x000000 (black).
 
weight:Number (default = 0) — Specifies the line weight, in pixels. The default value is 0.
 
alpha:Number (default = 1.0) — Specifies the alpha value in the range 0.0 to 1.0. The default value is 1.0 (opaque).
 
pixelHinting:Boolean (default = false) — Specifies whether to hint strokes to full pixels. This value affects both the position of anchors of a curve and the line stroke size itself. The default value is false.
 
scaleMode:String (default = "normal") — Specifies how to scale a stroke. Valid values are "normal", "none", "vertical", and "noScale". The default value is "normal".
 
caps:String (default = null) — Specifies the type of caps at the end of lines. Valid values are "round", "square", and "none". The default value is null.
 
joints:String (default = null) — Specifies the type of joint appearance used at angles. Valid values are "round", "miter", and "bevel". The default value is null.
 
miterLimit:Number (default = 0) — Indicates the limit at which a miter is cut off. Valid values range from 0 to 255. The default value is 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 Stroke's styles are applied.