StrokeStyle

Defines a stroke line and fill style for a line segment, a curve or a graphics primitive object.

Summary
StrokeStyleDefines a stroke line and fill style for a line segment, a curve or a graphics primitive object.
Public static constants
maxGradientColorsMaximum number of gradient colors in a fill.
Public line properties
widthLine width
colorLine color
alphaLine alpha
pixelHintingLine is drawn with pixel hinting
scaleModeLine LineScaleMode enum
capsLine CapsStyle enum
jointsLine JointStyle enum
miterLimitLine miter cutoff limit
Public fill properties
numFillColorsNumber of fill colors (0 is transparent, 1 is solid else 2-6 are gradients)
solidFillColorSolid fill color
solidFillAlphaSolid fill alpha
fillTypeGradient fill GradientType enum
spreadGradient fill SpreadMethod enum
interpolationGradient fill InterpolationMethod enum
focalPointRatioGradient fill focal point ratio
boxWidthGradient fill box width
boxHeightGradient fill box height
boxRotationGradient fill box rotation
boxTxGradient fill box X-axis offset
boxTyGradient fill box Y-axis offset
fillColorArrayArray of gradient fill color RGB values
fillAlphaArrayArray of gradient fill alphas
fillRatioArrayArray of gradient fill distribution ratios
Construction/destruction
StrokeStyleCreates a stroke style object holding line style and solid or gradient fill properties for a StrokeItem.
cloneReturns a deep-copy of the StrokeStyle instance.
disposeRemove resources and references held by this object.
Comparison
isStrokeEqualCompares the line style properties of this StrokeStyle with another instance to see if they are equal.
isFillEqualCompares the fill properties of this StrokeStyle with another instance to see if they are equal.
Style manipulation
scaleScale the width of the line according the requested scaling and the setting of the LineScaleMode property.
Reverse engineering
setStyleParamsSets the line style properties to the given parameters.
setFillParamsSets the solid fill properties to the given parameters.
setEndFillSets the fill properties to transparent.
setGradientParamsSets the linear or radial gradient fill properties to the given parameters.
setBoxParamsSets the gradient box properties to the given parameters.

Public static constants

maxGradientColors

public static const maxGradientColors: uint

Maximum number of gradient colors in a fill.

Set to 6 colors so a UI can be created in an acceptable way, the Flash runtime limit is 15.

Public line properties

width

public var width: Number

Line width

color

public var color: uint

Line color

alpha

public var alpha: Number

Line alpha

pixelHinting

public var pixelHinting: Boolean

Line is drawn with pixel hinting

scaleMode

public var scaleMode: String

Line LineScaleMode enum

caps

public var caps: String

Line CapsStyle enum

joints

public var joints: String

Line JointStyle enum

miterLimit

public var miterLimit: Number

Line miter cutoff limit

Public fill properties

numFillColors

public var numFillColors: int

Number of fill colors (0 is transparent, 1 is solid else 2-6 are gradients)

solidFillColor

public var solidFillColor: uint

Solid fill color

solidFillAlpha

public var solidFillAlpha: Number

Solid fill alpha

fillType

public var fillType: String

Gradient fill GradientType enum

spread

public var spread: String

Gradient fill SpreadMethod enum

interpolation

public var interpolation: String

Gradient fill InterpolationMethod enum

focalPointRatio

public var focalPointRatio: Number

Gradient fill focal point ratio

boxWidth

public var boxWidth: Number

Gradient fill box width

boxHeight

public var boxHeight: Number

Gradient fill box height

boxRotation

public var boxRotation: Number

Gradient fill box rotation

boxTx

public var boxTx: Number

Gradient fill box X-axis offset

boxTy

public var boxTy: Number

Gradient fill box Y-axis offset

fillColorArray

public var fillColorArray: Array

Array of gradient fill color RGB values

fillAlphaArray

public var fillAlphaArray: Array

Array of gradient fill alphas

fillRatioArray

public var fillRatioArray: Array

Array of gradient fill distribution ratios

Construction/destruction

StrokeStyle

public function StrokeStyle(strokeWidth: Number = 1.0,
strokeColor: uint = 0x000000,
transparency: Number = 1.0,
usePixelHinting: Boolean = false,
strokeScaleMode: String = "normal",
capStyle: String = "round",
jointStyle: String = "round",
strokeMiterLimit: Number = 3,
numColorsInFill: uint = 0,
fillColor: uint = 0x000000,
fillAlpha: Number = 1.0,
gradientType: String = "linear",
spreadMethod: String = "pad",
interpolationMethod: String = "rgb",
focalRatio: Number = 0,
gradientBoxWidth: Number = 100,
gradientBoxHeight: Number = 100,
gradientBoxRotation: Number = 0,
gradientBoxTx: Number = 0,
gradientBoxTy: Number = 0,
fillColors: Array = null,
fillAlphas: Array = null,
fillRatios: Array = null)

Creates a stroke style object holding line style and solid or gradient fill properties for a StrokeItem.

Initializes gradient fill arrays if they are not given.

Parameters

strokeWidthline width
strokeColorline color
transparencyline alpha
usePixelHintingline is drawn with pixel hinting
strokeScaleModeline LineScaleMode enum
capStyleline CapsStyle enum
jointStyleline JointStyle enum
strokeMiterLimitline miter cutoff limit
numColorsInFillnumber of fill colors (0 is transparent, 1 is solid else 2-6 are gradients)
fillColorsolid fill color
fillAlphasolid fill alpha
gradientTypegradient fill GradientType enum
spreadMethodgradient fill SpreadMethod enum
interpolationMethodgradient fill InterpolationMethod enum
focalRatiogradient fill focal point ratio
gradientBoxWidthgradient fill box width
gradientBoxHeightgradient fill box height
gradientBoxRotationgradient fill box rotation
gradientBoxTxgradient fill box X-axis offset
gradientBoxTygradient fill box Y-axis offset
fillColorsarray of gradient fill color RGB values
fillAlphasarray of gradient fill alphas
fillRatiosarray of gradient fill distribution ratios

clone

public function clone():StrokeStyle

Returns a deep-copy of the StrokeStyle instance.

dispose

public function dispose():void

Remove resources and references held by this object.

Comparison

isStrokeEqual

public function isStrokeEqual(style: StrokeStyle):Boolean

Compares the line style properties of this StrokeStyle with another instance to see if they are equal.

Parameters

stylea StrokeStyle object

Returns

true if equal, false otherwise

isFillEqual

public function isFillEqual(style: StrokeStyle):Boolean

Compares the fill properties of this StrokeStyle with another instance to see if they are equal.

Parameters

stylea StrokeStyle object

Returns

true if equal, false otherwise

Style manipulation

scale

public function scale(xScale: Number,
yScale: Number):void

Scale the width of the line according the requested scaling and the setting of the LineScaleMode property.

Parameters

xScaleScaling in the X-axis dimension
yScaleScaling in the Y-axis dimension

Reverse engineering

setStyleParams

public function setStyleParams(params: Array):void

Sets the line style properties to the given parameters.

Parameters

paramsarray of parameters as obtained from MethodParser.parseParameters

setFillParams

public function setFillParams(params: Array):void

Sets the solid fill properties to the given parameters.

Parameters

paramsarray of parameters as obtained from MethodParser.parseParameters

setEndFill

public function setEndFill():void

Sets the fill properties to transparent.

setGradientParams

public function setGradientParams(params: Array):void

Sets the linear or radial gradient fill properties to the given parameters.

Parameters

paramsarray of parameters as obtained from MethodParser.parseParameters

setBoxParams

public function setBoxParams(params: Array):void

Sets the gradient box properties to the given parameters.

Parameters

paramsarray of parameters as obtained from MethodParser.parseParameters
public static const maxGradientColors: uint
Maximum number of gradient colors in a fill.
public var width: Number
Line width
public var color: uint
Line color
public var alpha: Number
Line alpha
public var pixelHinting: Boolean
Line is drawn with pixel hinting
public var scaleMode: String
Line LineScaleMode enum
public var caps: String
Line CapsStyle enum
public var joints: String
Line JointStyle enum
public var miterLimit: Number
Line miter cutoff limit
public var numFillColors: int
Number of fill colors (0 is transparent, 1 is solid else 2-6 are gradients)
public var solidFillColor: uint
Solid fill color
public var solidFillAlpha: Number
Solid fill alpha
public var fillType: String
Gradient fill GradientType enum
public var spread: String
Gradient fill SpreadMethod enum
public var interpolation: String
Gradient fill InterpolationMethod enum
public var focalPointRatio: Number
Gradient fill focal point ratio
public var boxWidth: Number
Gradient fill box width
public var boxHeight: Number
Gradient fill box height
public var boxRotation: Number
Gradient fill box rotation
public var boxTx: Number
Gradient fill box X-axis offset
public var boxTy: Number
Gradient fill box Y-axis offset
public var fillColorArray: Array
Array of gradient fill color RGB values
public var fillAlphaArray: Array
Array of gradient fill alphas
public var fillRatioArray: Array
Array of gradient fill distribution ratios
public function StrokeStyle(strokeWidth: Number = 1.0,
strokeColor: uint = 0x000000,
transparency: Number = 1.0,
usePixelHinting: Boolean = false,
strokeScaleMode: String = "normal",
capStyle: String = "round",
jointStyle: String = "round",
strokeMiterLimit: Number = 3,
numColorsInFill: uint = 0,
fillColor: uint = 0x000000,
fillAlpha: Number = 1.0,
gradientType: String = "linear",
spreadMethod: String = "pad",
interpolationMethod: String = "rgb",
focalRatio: Number = 0,
gradientBoxWidth: Number = 100,
gradientBoxHeight: Number = 100,
gradientBoxRotation: Number = 0,
gradientBoxTx: Number = 0,
gradientBoxTy: Number = 0,
fillColors: Array = null,
fillAlphas: Array = null,
fillRatios: Array = null)
Creates a stroke style object holding line style and solid or gradient fill properties for a StrokeItem.
Defines a stroke item structure, that is a curve or line segment point or an object such as a circle, ellipse or rectangle.
public function clone():StrokeStyle
Returns a deep-copy of the StrokeStyle instance.
public function dispose():void
Remove resources and references held by this object.
public function isStrokeEqual(style: StrokeStyle):Boolean
Compares the line style properties of this StrokeStyle with another instance to see if they are equal.
public function isFillEqual(style: StrokeStyle):Boolean
Compares the fill properties of this StrokeStyle with another instance to see if they are equal.
public function scale(xScale: Number,
yScale: Number):void
Scale the width of the line according the requested scaling and the setting of the LineScaleMode property.
public function setStyleParams(params: Array):void
Sets the line style properties to the given parameters.
public function setFillParams(params: Array):void
Sets the solid fill properties to the given parameters.
public function setEndFill():void
Sets the fill properties to transparent.
public function setGradientParams(params: Array):void
Sets the linear or radial gradient fill properties to the given parameters.
public function setBoxParams(params: Array):void
Sets the gradient box properties to the given parameters.
private function parseParameters(paramList: String,
paramArray: Array):void
Scans action method call parameters, pushes found parameters on the given paramArray reference.
Close