適用於 Adobe® Flash® Platform 的 ActionScript® 3.0 參考
首頁  |  隱藏套件和類別清單 |  套件  |  類別  |  新增內容  |  索引  |  附錄  |  為什麼顯示英文?
篩選: AIR 30.0 和更早版本, Flash Player 30.0 和更早版本, Flash Lite 4
Flex 4.6 和更早版本, Flash Pro CS6 和更早版本
隱藏篩選
mx.graphics 

GradientStroke  - AS3 Flex

套件mx.graphics
類別public class GradientStroke
繼承GradientStroke Inheritance GradientBase Inheritance EventDispatcher Inheritance Object
實作 IStroke
子類別 LinearGradientStroke, RadialGradientStroke

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

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

預設 MXML 屬性entries

相關 API 元素



公用屬性
 屬性定義自
 Inheritedangle : Number
已不建議使用: 請使用 rotation
By default, the LinearGradientStroke defines a transition from left to right across the control.
GradientBase
  caps : String
Specifies the appearance of the ends of lines.
GradientStroke
 Inheritedconstructor : Object
類別物件的參照或是特定物件實體的建構函數。
Object
 Inheritedentries : Array
An Array of GradientEntry objects defining the fill patterns for the gradient fill.
GradientBase
 InheritedinterpolationMethod : String
A value from the InterpolationMethod class that specifies which interpolation method to use.
GradientBase
  joints : String
A value from the JointStyle class that specifies the type of joint appearance used at angles.
GradientStroke
 Inheritedmatrix : Matrix
An array of values used for matrix transformation.
GradientBase
  miterLimit : Number
A number that indicates the limit at which a miter is cut off.
GradientStroke
  pixelHinting : Boolean
A Boolean value that specifies whether to hint strokes to full pixels.
GradientStroke
 Inheritedrotation : Number
By default, the LinearGradientStroke defines a transition from left to right across the control.
GradientBase
  scaleMode : String
Specifies which scale mode to use.
GradientStroke
 InheritedspreadMethod : String
A value from the SpreadMethod class that specifies which spread method to use.
GradientBase
  weight : Number
The stroke weight, in pixels.
GradientStroke
 Inheritedx : Number
The distance by which to translate each point along the x axis.
GradientBase
 Inheritedy : Number
The distance by which to translate each point along the y axis.
GradientBase
保護屬性
 屬性定義自
 InheritedcompoundTransform : mx.geom:CompoundTransform
Holds the matrix and the convenience transform properties (x, y, and rotation).
GradientBase
公用方法
 方法定義自
  
GradientStroke(weight:Number = 1, pixelHinting:Boolean = false, scaleMode:String = "normal", caps:String = "round", joints:String = "round", miterLimit:Number = 3)
Constructor.
GradientStroke
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。
EventDispatcher
  
apply(g:Graphics, targetBounds:Rectangle, targetOrigin:Point):void
Applies the properties to the specified Graphics object.
GradientStroke
  
Generates a GraphicsStroke object representing this stroke.
GradientStroke
 Inherited
會將事件傳送到事件流程。
EventDispatcher
 Inherited
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。
EventDispatcher
 Inherited
指出物件是否有已定義的指定屬性。
Object
 Inherited
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。
Object
 Inherited
指出指定的屬性是否存在,以及是否可列舉。
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
會從 EventDispatcher 物件移除偵聽程式。
EventDispatcher
 Inherited
為迴圈作業設定動態屬性的可用性。
Object
 Inherited
傳回代表此物件的字串,根據地區特定慣例進行格式化。
Object
 Inherited
會傳回指定之物件的字串形式。
Object
 Inherited
會傳回指定之物件的基本值。
Object
 Inherited
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。
EventDispatcher
事件
 事件 摘要 定義自
 Inherited[廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。EventDispatcher
 Inherited[廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。EventDispatcher
屬性詳細資訊

caps

屬性
caps:String

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Specifies the appearance of the ends of lines.

Valid values are CapsStyle.NONE, CapsStyle.ROUND, and CapsStyle.SQUARE. A null value is equivalent to CapsStyle.ROUND.

預設值為 CapsStyle.ROUND。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 propertyChange 事件。



實作
    public function get caps():String
    public function set caps(value:String):void

相關 API 元素

flash.display.CapStyle

joints

屬性 
joints:String

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

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

預設值為 JointStyle.ROUND。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 propertyChange 事件。



實作
    public function get joints():String
    public function set joints(value:String):void

相關 API 元素

miterLimit

屬性 
miterLimit:Number

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

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

The value of the miterLimit property 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.

預設值為 3。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 propertyChange 事件。



實作
    public function get miterLimit():Number
    public function set miterLimit(value:Number):void

pixelHinting

屬性 
pixelHinting:Boolean

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

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.

預設值為 false。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 propertyChange 事件。



實作
    public function get pixelHinting():Boolean
    public function set pixelHinting(value:Boolean):void

scaleMode

屬性 
scaleMode:String

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Specifies which scale mode to use. Value valids are:

  • 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.
  • LineScaleMode.HORIZONTAL— Do not scale the line thickness if the object is scaled horizontally only.

預設值為 LineScaleMode.NORMAL。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 propertyChange 事件。



實作
    public function get scaleMode():String
    public function set scaleMode(value:String):void

相關 API 元素

weight

屬性 
weight:Number

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

The stroke weight, in pixels.

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 propertyChange 事件。



實作
    public function get weight():Number
    public function set weight(value:Number):void
建構函式詳細資料

GradientStroke

()建構函式
public function GradientStroke(weight:Number = 1, pixelHinting:Boolean = false, scaleMode:String = "normal", caps:String = "round", joints:String = "round", miterLimit:Number = 3)

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Constructor.

參數
weight:Number (default = 1) — Specifies the line weight, in pixels. This parameter is optional, with a default value of 1.
 
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 = "round") — 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 CapsStyle.ROUND.
 
joints:String (default = "round") — 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 JointStyle.ROUND. This parameter is optional, with a default value of JointStyle.ROUND.
 
miterLimit:Number (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 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 3.
方法詳細資訊

apply

()方法
public function apply(g:Graphics, targetBounds:Rectangle, targetOrigin:Point):void

語言版本: ActionScript 3.0
產品版本: Flex 4
執行階段版本: Flash Player 9, AIR 1.1

Applies the properties to the specified Graphics object.

參數

g:Graphics — The Graphics object to apply the properties to.
 
targetBounds:Rectangle — The bounds of the shape that the stroke is applied to.
 
targetOrigin:Point — The Point that defines the origin (0,0) of the shape in the coordinate system of target.

createGraphicsStroke

()方法 
public function createGraphicsStroke(targetBounds:Rectangle, targetOrigin:Point):GraphicsStroke

語言版本: ActionScript 3.0
產品版本: Flex 4
執行階段版本: Flash Player 9, AIR 1.1

Generates a GraphicsStroke object representing this stroke.

參數

targetBounds:Rectangle — The stroke's bounding box.
 
targetOrigin:Point — The Point that defines the origin (0,0) of the shape in the coordinate system of target.

傳回值
GraphicsStroke — The Drawing API-2 GraphicsStroke object representing this stroke.




[ X ]為什麼顯示英文?
「ActionScript 3.0 參考」的內容是以英文顯示

並非所有「ActionScript 3.0 參考」的內容都翻譯為所有語言。當語言元素未翻譯時,就會以英文顯示。例如,ga.controls.HelpBox 類別並沒有翻譯為任何語言。因此在參考的繁體中文版本中,ga.controls.HelpBox 類別就會以英文顯示。