語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
更多範例
屬性 | 定義自 | ||
---|---|---|---|
accessibilityProperties : AccessibilityProperties
此顯示物件的目前輔助功能選項。 | DisplayObject | ||
alpha : Number
指出所指定物件的 Alpha 透明度值。 | DisplayObject | ||
blendMode : String
來自 BlendMode 類別的值,會指定要使用何種混合模式。 | DisplayObject | ||
blendShader : Shader [唯寫]
設定用來混合前景和背景的著色器。 | DisplayObject | ||
cacheAsBitmap : Boolean
如果設定為 true,Flash 執行階段會快取顯示物件的內部點陣圖表示法。 | DisplayObject | ||
cacheAsBitmapMatrix : Matrix
如果為非 null,當 cacheAsBitmap 設定為 true 時,這個 Matrix 物件會定義顯示物件的顯示方法。 | DisplayObject | ||
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | ||
filters : Array
索引的陣列,其中包含目前和顯示物件相關的每個濾鏡物件。 | DisplayObject | ||
graphics : Graphics [唯讀]
指定屬於此 Shape 物件的 Graphics 物件,其中可能會產生向量繪圖命令。 | Shape | ||
height : Number
會指出顯示物件的高度,以像素為單位。 | DisplayObject | ||
initialized : Boolean
A flag that determines if an object has been through all three phases
of layout: commitment, measurement, and layout (provided that any were required). | ProgrammaticSkin | ||
loaderInfo : LoaderInfo [唯讀]
會傳回 LoaderInfo 物件,其中包含關於載入此顯示物件所屬之檔案的資訊。 | DisplayObject | ||
mask : DisplayObject
呼叫之顯示物件會以指定的 mask 物件遮蓋。 | DisplayObject | ||
measuredHeight : Number [唯讀]
The measured height of this object. | ProgrammaticSkin | ||
measuredWidth : Number [唯讀]
The measured width of this object. | ProgrammaticSkin | ||
metaData : Object
如果中繼資料是透過 PlaceObject4 標籤與 SWF 檔案中的這個 DisplayObject 實體一同儲存,則會取得 DisplayObject 實體的中繼資料物件。 | DisplayObject | ||
mouseX : Number [唯讀]
指出滑鼠或使用者輸入裝置位置的 x 座標,以像素為單位。 | DisplayObject | ||
mouseY : Number [唯讀]
指出滑鼠或使用者輸入裝置位置的 y 座標,以像素為單位。 | DisplayObject | ||
name : String
指出 DisplayObject 的實體名稱。 | DisplayObject | ||
nestLevel : int
Depth of this object in the containment hierarchy. | ProgrammaticSkin | ||
opaqueBackground : Object
會指定顯示物件是否不透明,並具有特定背景顏色。 | DisplayObject | ||
parent : DisplayObjectContainer [唯讀]
指出包含此顯示物件的 DisplayObjectContainer 物件。 | DisplayObject | ||
processedDescriptors : Boolean
Set to true after immediate or deferred child creation,
depending on which one happens. | ProgrammaticSkin | ||
root : DisplayObject [唯讀]
對載入之 SWF 檔案的顯示物件而言,root 屬性就是該 SWF 檔案所呈現之顯示清單樹狀結構部分的最上層顯示物件。 | DisplayObject | ||
rotation : Number
指出 DisplayObject 實體的旋轉度數 (從該物件原本方向算起)。 | DisplayObject | ||
rotationX : Number
表示 DisplayObject 實體相對於 3D 父輩容器從原始方向旋轉的 x 軸旋轉 (以度數為單位)。 | DisplayObject | ||
rotationY : Number
表示 DisplayObject 實體相對於 3D 父輩容器從原始方向旋轉的 y 軸旋轉 (以度數為單位)。 | DisplayObject | ||
rotationZ : Number
表示 DisplayObject 實體相對於 3D 父輩容器從原始方向旋轉的 z 軸旋轉 (以度數為單位)。 | DisplayObject | ||
scale9Grid : Rectangle
目前產生效用的縮放格線。 | DisplayObject | ||
scaleX : Number
指出從註冊點套用的物件水平縮放 (百分比)。 | DisplayObject | ||
scaleY : Number
指出從物件註冊點套用的物件垂直縮放 (百分比)。 | DisplayObject | ||
scaleZ : Number
指出從物件註冊點套用的物件深度縮放 (百分比)。 | DisplayObject | ||
scrollRect : Rectangle
顯示物件的捲動矩形範圍。 | DisplayObject | ||
stage : Stage [唯讀]
顯示物件的「舞台」。 | DisplayObject | ||
styleName : Object
A parent component used to obtain style values. | ProgrammaticSkin | ||
transform : flash.geom:Transform
這是一個物件,具有和顯示物件的矩陣、顏色轉換和像素邊界有關的屬性。 | DisplayObject | ||
updateCompletePendingFlag : Boolean
A flag that determines if an object has been through all three phases
of layout validation (provided that any were required). | ProgrammaticSkin | ||
visible : Boolean
不管是否看得見顯示物件。 | DisplayObject | ||
width : Number
會指出顯示物件的寬度,以像素為單位。 | DisplayObject | ||
x : Number
指出 DisplayObject 實體相對於父輩 DisplayObjectContainer 之區域座標的 x 座標。 | DisplayObject | ||
y : Number
指出 DisplayObject 實體相對於父輩 DisplayObjectContainer 之區域座標的 y 座標。 | DisplayObject | ||
z : Number
表示 DisplayObject 實體相對於 3D 父輩容器的 z 座標位置 (沿著 z 軸)。 | DisplayObject |
方法 | 定義自 | ||
---|---|---|---|
Constructor. | ProgrammaticSkin | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。 | EventDispatcher | ||
會將事件傳送到事件流程。 | EventDispatcher | ||
傳回可定義顯示物件區域 (相對於 targetCoordinateSpace 物件的座標系統) 的矩形。 | DisplayObject | ||
根據 targetCoordinateSpace 參數所定義的座標系統,並排除形狀上的任何筆畫,傳回可定義顯示物件邊界的矩形。 | DisplayObject | ||
Returns the value of the specified style property. | ProgrammaticSkin | ||
將 point 物件從「舞台」(全域) 座標轉換成顯示物件的 (區域) 座標。 | DisplayObject | ||
將二維點從「舞台」(全域) 座標轉換為三維顯示物件的 (區域) 座標。 | DisplayObject | ||
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | EventDispatcher | ||
指出物件是否有已定義的指定屬性。 | Object | ||
評估顯示物件的範圍框,看它是否與 obj 顯示物件的範圍框重疊或相交。 | DisplayObject | ||
評估顯示物件,看它是否與 x 和 y 參數所指定的點重疊或相交。 | DisplayObject | ||
Marks a component so that its updateDisplayList()
method gets called during a later screen update. | ProgrammaticSkin | ||
Calling this method results in a call to the component's
validateProperties() method
before the display list is rendered. | ProgrammaticSkin | ||
Calling this method results in a call to the component's
validateSize() method
before the display list is rendered. | ProgrammaticSkin | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
將三維顯示物件的 (區域) 座標的三維點轉換為「舞台」(全域) 座標中的二維點。 | DisplayObject | ||
將 point 物件從顯示物件的 (區域) 座標轉換成「舞台」(全域) 座標。 | DisplayObject | ||
Moves this object to the specified x and y coordinates. | ProgrammaticSkin | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | ||
Sets the height and width of this object. | ProgrammaticSkin | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
Whenever any style changes, redraw this skin. | ProgrammaticSkin | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
[覆寫]
Returns a string indicating the location of this object
within the hierarchy of DisplayObjects in the Application. | FlexShape | ||
This function is called by the LayoutManager
when it's time for this control to draw itself. | ProgrammaticSkin | ||
Validate and update the properties and layout of this object
and redraw it, if necessary. | ProgrammaticSkin | ||
This function is an empty stub so that ProgrammaticSkin
can implement the ILayoutManagerClient interface. | ProgrammaticSkin | ||
This function is an empty stub so that ProgrammaticSkin
can implement the ILayoutManagerClient interface. | ProgrammaticSkin | ||
會傳回指定之物件的基本值。 | Object | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher |
方法 | 定義自 | ||
---|---|---|---|
drawRoundRect(x:Number, y:Number, width:Number, height:Number, cornerRadius:Object = null, color:Object = null, alpha:Object = null, gradientMatrix:Matrix = null, gradientType:String = "linear", gradientRatios:Array = null, hole:Object = null):void
Programatically draws a rectangle into this skin's Graphics object. | ProgrammaticSkin | ||
Utility function to create a horizontal gradient matrix. | ProgrammaticSkin | ||
Utility function to create a rotated gradient matrix. | ProgrammaticSkin | ||
Programmatically draws the graphics for this skin. | ProgrammaticSkin | ||
Utility function to create a vertical gradient matrix. | ProgrammaticSkin |
initialized | 屬性 |
initialized:Boolean
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
A flag that determines if an object has been through all three phases of layout: commitment, measurement, and layout (provided that any were required).
實作
public function get initialized():Boolean
public function set initialized(value:Boolean):void
measuredHeight | 屬性 |
measuredWidth | 屬性 |
nestLevel | 屬性 |
nestLevel:int
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Depth of this object in the containment hierarchy. This number is used by the measurement and layout code. The value is 0 if this component is not on the DisplayList.
實作
public function get nestLevel():int
public function set nestLevel(value:int):void
processedDescriptors | 屬性 |
processedDescriptors:Boolean
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Set to true
after immediate or deferred child creation,
depending on which one happens. For a Container object, it is set
to true
at the end of
the createComponentsFromDescriptors()
method,
meaning after the Container object creates its children from its child descriptors.
For example, if an Accordion container uses deferred instantiation,
the processedDescriptors
property for the second pane of
the Accordion container does not become true
until after
the user navigates to that pane and the pane creates its children.
But, if the Accordion had set the creationPolicy
property
to "all"
, the processedDescriptors
property
for its second pane is set to true
during application startup.
For classes that are not containers, which do not have descriptors,
it is set to true
after the createChildren()
method creates any internal component children.
實作
public function get processedDescriptors():Boolean
public function set processedDescriptors(value:Boolean):void
styleName | 屬性 |
updateCompletePendingFlag | 屬性 |
updateCompletePendingFlag:Boolean
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
A flag that determines if an object has been through all three phases of layout validation (provided that any were required).
實作
public function get updateCompletePendingFlag():Boolean
public function set updateCompletePendingFlag(value:Boolean):void
ProgrammaticSkin | () | 建構函式 |
public function ProgrammaticSkin()
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Constructor.
drawRoundRect | () | 方法 |
protected function drawRoundRect(x:Number, y:Number, width:Number, height:Number, cornerRadius:Object = null, color:Object = null, alpha:Object = null, gradientMatrix:Matrix = null, gradientType:String = "linear", gradientRatios:Array = null, hole:Object = null):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Programatically draws a rectangle into this skin's Graphics object.
The rectangle can have rounded corners. Its edges are stroked with the current line style of the Graphics object. It can have a solid color fill, a gradient fill, or no fill. A solid fill can have an alpha transparency. A gradient fill can be linear or radial. You can specify up to 15 colors and alpha values at specified points along the gradient, and you can specify a rotation angle or transformation matrix for the gradient. Finally, the rectangle can have a rounded rectangular hole carved out of it.
This versatile rectangle-drawing routine is used by many skins.
It calls the drawRect()
or
drawRoundRect()
methods (in the flash.display.Graphics class) to draw into this
skin's Graphics object.
參數
x:Number — Horizontal position of upper-left corner
of rectangle within this skin.
| |
y:Number — Vertical position of upper-left corner
of rectangle within this skin.
| |
width:Number — Width of rectangle, in pixels.
| |
height:Number — Height of rectangle, in pixels.
| |
cornerRadius:Object (default = null ) — Corner radius/radii of rectangle.
Can be null , a Number, or an Object.
If it is null , it specifies that the corners should be square
rather than rounded.
If it is a Number, it specifies the same radius, in pixels,
for all four corners.
If it is an Object, it should have properties named
tl , tr , bl , and
br , whose values are Numbers specifying
the radius, in pixels, for the top left, top right,
bottom left, and bottom right corners.
For example, you can pass a plain Object such as
{ tl: 5, tr: 5, bl: 0, br: 0 } .
The default value is null (square corners).
| |
color:Object (default = null ) — The RGB color(s) for the fill.
Can be null , a uint, or an Array.
If it is null , the rectangle not filled.
If it is a uint, it specifies an RGB fill color.
For example, pass 0xFF0000 to fill with red.
If it is an Array, it should contain uints
specifying the gradient colors.
For example, pass [ 0xFF0000, 0xFFFF00, 0x0000FF ]
to fill with a red-to-yellow-to-blue gradient.
You can specify up to 15 colors in the gradient.
The default value is null (no fill).
| |
alpha:Object (default = null ) — Alpha value(s) for the fill.
Can be null, a Number, or an Array.
This argument is ignored if color is null.
If color is a uint specifying an RGB fill color,
then alpha should be a Number specifying
the transparency of the fill, where 0.0 is completely transparent
and 1.0 is completely opaque.
You can also pass null instead of 1.0 in this case
to specify complete opaqueness.
If color is an Array specifying gradient colors,
then alpha should be an Array of Numbers, of the
same length, that specifies the corresponding alpha values
for the gradient.
In this case, the default value is null (completely opaque).
| |
gradientMatrix:Matrix (default = null ) — Matrix object used for the gradient fill.
The utility methods horizontalGradientMatrix() ,
verticalGradientMatrix() , and
rotatedGradientMatrix() can be used to create the value for
this parameter.
| |
gradientType:String (default = "linear ") — Type of gradient fill. The possible values are
GradientType.LINEAR or GradientType.RADIAL .
(The GradientType class is in the package flash.display.)
| |
gradientRatios:Array (default = null ) — (optional default [0,255])
Specifies the distribution of colors. The number of entries must match
the number of colors defined in the color parameter.
Each value defines the percentage of the width where the color is
sampled at 100%. The value 0 represents the left-hand position in
the gradient box, and 255 represents the right-hand position in the
gradient box.
| |
hole:Object (default = null ) — (optional) A rounded rectangular hole
that should be carved out of the middle
of the otherwise solid rounded rectangle
{ x: #, y: #, w: #, h: #, r: # or { br: #, bl: #, tl: #, tr: # } }
|
相關 API 元素
getStyle | () | 方法 |
public function getStyle(styleProp:String):*
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Returns the value of the specified style property.
參數
styleProp:String — Name of the style property.
|
* — The style value. This can be any type of object that style properties can be, such as
int, Number, String, etc.
|
horizontalGradientMatrix | () | 方法 |
protected function horizontalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Utility function to create a horizontal gradient matrix.
參數
x:Number — The left edge of the gradient.
| |
y:Number — The top edge of the gradient.
| |
width:Number — The width of the gradient.
| |
height:Number — The height of the gradient.
|
Matrix — The horizontal gradient matrix. This is a temporary
object that should only be used for a single subsequent call
to the drawRoundRect() method.
|
invalidateDisplayList | () | 方法 |
public function invalidateDisplayList():void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Marks a component so that its updateDisplayList()
method gets called during a later screen update.
Invalidation is a useful mechanism for eliminating duplicate work by delaying processing of changes to a component until a later screen update. For example, if you want to change the width and height, it would be wasteful to update the component immediately after you change the width and then update again with the new height. It is more efficient to change both properties and then render the component with its new size once.
Invalidation methods rarely get called. In general, setting a property on a component automatically calls the appropriate invalidation method.
invalidateProperties | () | 方法 |
public function invalidateProperties():void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Calling this method results in a call to the component's
validateProperties()
method
before the display list is rendered.
For components that extend UIComponent, this implies
that commitProperties()
is called.
invalidateSize | () | 方法 |
public function invalidateSize():void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Calling this method results in a call to the component's
validateSize()
method
before the display list is rendered.
For components that extend UIComponent, this implies
that measure()
is called, unless the component
has both explicitWidth
and explicitHeight
set.
move | () | 方法 |
rotatedGradientMatrix | () | 方法 |
protected function rotatedGradientMatrix(x:Number, y:Number, width:Number, height:Number, rotation:Number):Matrix
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Utility function to create a rotated gradient matrix.
參數
x:Number — The left edge of the gradient.
| |
y:Number — The top edge of the gradient.
| |
width:Number — The width of the gradient.
| |
height:Number — The height of the gradient.
| |
rotation:Number — The amount to rotate, in degrees.
|
Matrix — The horizontal gradient matrix. This is a temporary
object that should only be used for a single subsequent call
to the drawRoundRect() method.
|
setActualSize | () | 方法 |
styleChanged | () | 方法 |
public function styleChanged(styleProp:String):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Whenever any style changes, redraw this skin. Subclasses can override this method and perform a more specific test before calling invalidateDisplayList().
參數
styleProp:String — The name of the style property that changed, or null
if all styles have changed.
|
updateDisplayList | () | 方法 |
protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Programmatically draws the graphics for this skin.
Subclasses should override this method and include calls
to methods such as graphics.moveTo()
and
graphics.lineTo()
.
This occurs before any scaling from sources such as user code or zoom effects. The component is unaware of the scaling that takes place later.
參數
unscaledWidth:Number — The width, in pixels, of this object before any scaling.
| |
unscaledHeight:Number — The height, in pixels, of this object before any scaling.
|
更多範例
validateDisplayList | () | 方法 |
public function validateDisplayList():void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
This function is called by the LayoutManager
when it's time for this control to draw itself.
The actual drawing happens in the updateDisplayList
function, which is called by this function.
validateNow | () | 方法 |
public function validateNow():void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Validate and update the properties and layout of this object and redraw it, if necessary.
validateProperties | () | 方法 |
public function validateProperties():void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
This function is an empty stub so that ProgrammaticSkin
can implement the ILayoutManagerClient interface.
Skins do not call LayoutManager.invalidateProperties()
,
which would normally trigger a call to this method.
validateSize | () | 方法 |
public function validateSize(recursive:Boolean = false):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
This function is an empty stub so that ProgrammaticSkin
can implement the ILayoutManagerClient interface.
Skins do not call LayoutManager.invalidateSize()
,
which would normally trigger a call to this method.
參數
recursive:Boolean (default = false ) — Determines whether children of this skin are validated.
|
verticalGradientMatrix | () | 方法 |
protected function verticalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Utility function to create a vertical gradient matrix.
參數
x:Number — The left edge of the gradient.
| |
y:Number — The top edge of the gradient.
| |
width:Number — The width of the gradient.
| |
height:Number — The height of the gradient.
|
Matrix — The horizontal gradient matrix. This is a temporary
object that should only be used for a single subsequent call
to the drawRoundRect() method.
|
Tue Jun 12 2018, 03:47 PM Z