語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 2.5 |
更多範例
Basics of mobile skinning
Create a mobile skin class
Apply a custom mobile skin
屬性 | 定義自 | ||
---|---|---|---|
applicationDPI : Number [唯讀]
Returns the DPI of the application. | MobileSkin | ||
currentCSSState : String [唯讀]
The state to be used when matching CSS pseudo-selectors. | UIComponent | ||
focusSkinExclusions : Array [唯讀]
List of IDs of items that should be excluded when rendering the focus ring. | MobileSkin | ||
hasComplexLayoutMatrix : Boolean [唯讀]
Returns true if the UIComponent has any non-translation (x,y) transform properties. | UIComponent | ||
measuredDefaultHeight : Number = 0
Specifies a default height. | MobileSkin | ||
measuredDefaultWidth : Number = 0
Specifies a default width. | MobileSkin | ||
resourceManager : IResourceManager [唯讀]
A reference to the object which manages
all of the application's localized resources. | UIComponent | ||
symbolItems : Array [唯讀]
Names of items that should have their color property defined by
the symbolColor style. | MobileSkin | ||
unscaledHeight : Number [唯讀]
A convenience method for determining the unscaled height
of the component. | UIComponent | ||
unscaledWidth : Number [唯讀]
A convenience method for determining the unscaled width
of the component
All of a component's drawing and child layout should be done
within a bounding rectangle of this width, which is also passed
as an argument to updateDisplayList(). | UIComponent | ||
useSymbolColor : Boolean = false
Specifies whether or not this skin should be affected by the symbolColor style. | MobileSkin |
方法 | 定義自 | ||
---|---|---|---|
Constructor. | MobileSkin | ||
將 DisplayObject 子實體加入至此 DisplayObjectContainer 實體。 | DisplayObjectContainer | ||
將 DisplayObject 子實體加入至此 DisplayObjectContainer 實體。 | DisplayObjectContainer | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。 | EventDispatcher | ||
Adds a non-visual style client to this component instance. | UIComponent | ||
指出安全性限制是否會造成傳回的清單 (可用指定的 point 點呼叫 DisplayObjectContainer.getObjectsUnderPoint() 方法來取得) 省略任何顯示物件。 | DisplayObjectContainer | ||
Called before a bitmap capture is made for this skin. | MobileSkin | ||
Queues a function to be called later. | UIComponent | ||
Deletes a style property from this component instance. | UIComponent | ||
判斷指定的顯示物件是否為 DisplayObjectContainer 實體的子系,或為實體本身。 | DisplayObjectContainer | ||
Converts a Point object from content coordinates to global coordinates. | UIComponent | ||
Converts a Point object from content to local coordinates. | UIComponent | ||
Returns a set of properties that identify the child within
this container. | UIComponent | ||
Returns a set of properties that identify the child within
this container. | UIComponent | ||
Creates an id reference to this IUIComponent object
on its parent document object. | UIComponent | ||
Deletes the id reference to this IUIComponent object
on its parent document object. | UIComponent | ||
Returns a UITextFormat object corresponding to the text styles
for this UIComponent. | UIComponent | ||
[覆寫]
Dispatches an event into the event flow. | UIComponent | ||
Shows or hides the focus indicator around this component. | UIComponent | ||
drawRoundRect(x:Number, y:Number, w:Number, h:Number, r:Object = null, c:Object = null, alpha:Object = null, rot:Object = null, gradient:String = null, ratios:Array = null, hole:Object = null):void
Programmatically draws a rectangle into this skin's Graphics object. | UIComponent | ||
Called by the effect instance when it stops playing on the component. | UIComponent | ||
Called by the effect instance when it starts playing on the component. | UIComponent | ||
Ends all currently playing effects on the component. | UIComponent | ||
Called after a bitmap capture is made for this skin. | MobileSkin | ||
Executes all the bindings for which the UIComponent object is the destination. | UIComponent | ||
Called after printing is complete. | UIComponent | ||
Provides the automation object at the specified index. | UIComponent | ||
Provides the automation object list . | UIComponent | ||
傳回可定義顯示物件區域 (相對於 targetCoordinateSpace 物件的座標系統) 的矩形。 | DisplayObject | ||
Returns the x coordinate of the element's bounds at the specified element size. | UIComponent | ||
Returns the y coordinate of the element's bounds at the specified element size. | UIComponent | ||
傳回存在於指定索引位置的子顯示物件實體。 | DisplayObjectContainer | ||
傳回具有指定名稱的子顯示物件。 | DisplayObjectContainer | ||
傳回 child DisplayObject 實體的索引位置。 | DisplayObjectContainer | ||
Finds the type selectors for this UIComponent instance. | UIComponent | ||
Returns a layout constraint value, which is the same as
getting the constraint style for this component. | UIComponent | ||
A convenience method for determining whether to use the
explicit or measured height
| UIComponent | ||
A convenience method for determining whether to use the
explicit or measured width
| UIComponent | ||
Gets the object that currently has focus. | UIComponent | ||
Returns the element's layout height. | UIComponent | ||
Returns the element's layout width. | UIComponent | ||
Returns the x coordinate that the element uses to draw on screen. | UIComponent | ||
Returns the y coordinate that the element uses to draw on screen. | UIComponent | ||
Returns the transform matrix that is used to calculate the component's
layout relative to its siblings. | UIComponent | ||
Returns the layout transform Matrix3D for this element. | UIComponent | ||
Returns the element's maximum height. | UIComponent | ||
Returns the element's maximum width. | UIComponent | ||
Returns the element's minimum height. | UIComponent | ||
Returns the element's minimum width. | UIComponent | ||
傳回位於指定點底下,且屬於此 DisplayObjectContainer 實體之子系 (或孫系,以下類推) 的物件陣列。 | DisplayObjectContainer | ||
Returns the element's preferred height. | UIComponent | ||
Returns the element's preferred width. | UIComponent | ||
根據 targetCoordinateSpace 參數所定義的座標系統,並排除形狀上的任何筆畫,傳回可定義顯示物件邊界的矩形。 | DisplayObject | ||
Returns the item in the dataProvider that was used
by the specified Repeater to produce this Repeater, or
null if this Repeater isn't repeated. | UIComponent | ||
Gets a style property that has been set anywhere in this
component's style lookup chain. | UIComponent | ||
Converts a Point object from global to content coordinates. | UIComponent | ||
將 point 物件從「舞台」(全域) 座標轉換成顯示物件的 (區域) 座標。 | DisplayObject | ||
將二維點從「舞台」(全域) 座標轉換為三維顯示物件的 (區域) 座標。 | DisplayObject | ||
Returns true if currentCSSState is not null. | UIComponent | ||
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | EventDispatcher | ||
指出物件是否有已定義的指定屬性。 | Object | ||
[覆寫]
MobileSkin does not use states. | MobileSkin | ||
評估顯示物件的範圍框,看它是否與 obj 顯示物件的範圍框重疊或相交。 | DisplayObject | ||
評估顯示物件,看它是否與 x 和 y 參數所指定的點重疊或相交。 | DisplayObject | ||
Returns a box Matrix which can be passed to the
drawRoundRect() method
as the rot parameter when drawing a horizontal gradient. | UIComponent | ||
Initializes the internal structure of this component. | UIComponent | ||
Initializes various properties which keep track of repeated instances
of this component. | UIComponent | ||
Marks a component so that its updateDisplayList()
method gets called during a later screen update. | UIComponent | ||
Called by a component's items to indicate that their depth
property has changed. | UIComponent | ||
An element must call this method when its layoutDirection changes or
when its parent's layoutDirection changes. | UIComponent | ||
Marks a component so that its commitProperties()
method gets called during a later screen update. | UIComponent | ||
Marks a component so that its measure()
method gets called during a later screen update. | UIComponent | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
將三維顯示物件的 (區域) 座標的三維點轉換為「舞台」(全域) 座標中的二維點。 | DisplayObject | ||
Converts a Point object from local to content coordinates. | UIComponent | ||
將 point 物件從顯示物件的 (區域) 座標轉換成「舞台」(全域) 座標。 | DisplayObject | ||
Returns true if cssState matches currentCSSState. | UIComponent | ||
Determines whether this instance is the same as, or is a subclass of,
the given type. | UIComponent | ||
Measures the specified HTML text, which can contain HTML tags such
as <font> and <b>,
assuming that it is displayed
in a single-line UITextField using a UITextFormat
determined by the styles of this UIComponent. | UIComponent | ||
Measures the specified text, assuming that it is displayed
in a single-line UITextField (or UIFTETextField) using a UITextFormat
determined by the styles of this UIComponent. | UIComponent | ||
Moves the component to a specified position within its parent. | UIComponent | ||
Propagates style changes to the children. | UIComponent | ||
Returns true if the chain of owner properties
points from child to this UIComponent. | UIComponent | ||
Called by Flex when a UIComponent object is added to or removed from a parent. | UIComponent | ||
Prepares an IFlexDisplayObject for printing. | UIComponent | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
Builds or rebuilds the CSS style cache for this component
and, if the recursive parameter is true,
for all descendants of this component as well. | UIComponent | ||
For each effect event, registers the EffectManager
as one of the event listeners. | UIComponent | ||
將指定的 child DisplayObject 實體從 DisplayObjectContainer 實體的子清單中移除。 | DisplayObjectContainer | ||
從 DisplayObjectContainer 子清單中的指定索引位置移除子 DisplayObject。 | DisplayObjectContainer | ||
將所有 child DisplayObject 實體從 DisplayObjectContainer 實體的子清單中移除。 | DisplayObjectContainer | ||
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | ||
Removes a non-visual style client from this component instance. | UIComponent | ||
Replays the specified event. | UIComponent | ||
升起顯示虛擬鍵盤。 | InteractiveObject | ||
Resolves a child by using the id provided. | UIComponent | ||
[靜態]
Resumes the background processing of methods
queued by callLater(), after a call to
suspendBackgroundProcessing(). | UIComponent | ||
Sizes the object. | UIComponent | ||
變更顯示物件容器中現有子系的位置。 | DisplayObjectContainer | ||
Sets a layout constraint value, which is the same as
setting the constraint style for this component. | UIComponent | ||
Set the current state. | UIComponent | ||
Sets the focus to this component. | UIComponent | ||
Sets the coordinates that the element uses to draw on screen. | UIComponent | ||
Sets the layout size of the element. | UIComponent | ||
Sets the transform Matrix that is used to calculate the component's layout
size and position relative to its siblings. | UIComponent | ||
Sets the transform Matrix3D that is used to calculate the component's layout
size and position relative to its siblings. | UIComponent | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
Sets a style property on this component instance. | UIComponent | ||
Called when the visible property changes. | UIComponent | ||
讓使用者拖曳指定的 sprite。 | Sprite | ||
讓使用者將指定的 Sprite 拖曳至觸控裝置上。 | Sprite | ||
遞迴停止執行所有 MovieClips 的時間軸根源於此物件。 | DisplayObjectContainer | ||
結束 startDrag() 方法。 | Sprite | ||
結束觸控裝置使用的 startTouchDrag() 方法。 | Sprite | ||
Detects changes to style properties. | UIComponent | ||
Flex calls the stylesInitialized() method when
the styles for a component are first initialized. | UIComponent | ||
[靜態]
Blocks the background processing of methods
queued by callLater(),
until resumeBackgroundProcessing() is called. | UIComponent | ||
替換兩個指定子物件的 z 順序 (深度階層,由前至後順序)。 | DisplayObjectContainer | ||
在子清單的兩個指定索引位置,替換子物件的 z 順序 (深度階層,由前至後順序)。 | DisplayObjectContainer | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
[覆寫]
Returns a string indicating the location of this object
within the hierarchy of DisplayObjects in the Application. | FlexSprite | ||
transformAround(transformCenter:Vector3D, scale:Vector3D = null, rotation:Vector3D = null, translation:Vector3D = null, postLayoutScale:Vector3D = null, postLayoutRotation:Vector3D = null, postLayoutTranslation:Vector3D = null, invalidateLayout:Boolean = true):void
A utility method to update the rotation, scale, and translation of the
transform while keeping a particular point, specified in the component's
own coordinate space, fixed in the parent's coordinate space. | UIComponent | ||
A utility method to transform a point specified in the local
coordinates of this object to its location in the object's parent's
coordinates. | UIComponent | ||
Validates the position and size of children and draws other
visuals. | UIComponent | ||
Validate and update the properties and layout of this object
and redraw it, if necessary. | UIComponent | ||
Used by layout logic to validate the properties of a component
by calling the commitProperties() method. | UIComponent | ||
Validates the measured size of the component
If the LayoutManager.invalidateSize() method is called with
this ILayoutManagerClient, then the validateSize() method
is called when it's time to do measurements. | UIComponent | ||
Handles both the valid and invalid events from a
validator assigned to this component. | UIComponent | ||
會傳回指定之物件的基本值。 | Object | ||
Returns a box Matrix which can be passed to drawRoundRect()
as the rot parameter when drawing a vertical gradient. | UIComponent | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher |
方法 | 定義自 | ||
---|---|---|---|
Adjust the focus rectangle. | UIComponent | ||
A helper method to set a color transform on a DisplayObject. | MobileSkin | ||
Commits the computed matrix built from the combination of the layout
matrix and the transform offsets to the flash displayObject's transform. | UIComponent | ||
This is an internal method used by the Flex framework
to support the Dissolve effect. | UIComponent | ||
Determines if the call to the measure() method can be skipped. | UIComponent | ||
Performs any final processing after child objects are created. | UIComponent | ||
Called whenever the currentState changes. | MobileSkin | ||
Processes the properties set on the component. | UIComponent | ||
Create child objects of the component. | UIComponent | ||
Creates a new object using a context
based on the embedded font being used. | UIComponent | ||
Creates the object using a given moduleFactory. | UIComponent | ||
Helper method for dispatching a PropertyChangeEvent
when a property is updated. | UIComponent | ||
Renders a background for the skin. | MobileSkin | ||
The event handler called when a UIComponent object gets focus. | UIComponent | ||
The event handler called when a UIComponent object loses focus. | UIComponent | ||
A helper method to retrieve the preferred height of a child element. | MobileSkin | ||
A helper method to retrieve the preferred width of a child element. | MobileSkin | ||
Initializes the implementation and storage of some of the less frequently
used advanced layout features of a component. | UIComponent | ||
Finalizes the initialization of this component. | UIComponent | ||
Initializes this component's accessibility code. | UIComponent | ||
Helper method to invalidate parent size and display list if
this object affects its layout (includeInLayout is true). | UIComponent | ||
Typically overridden by components containing UITextField objects,
where the UITextField object gets focus. | UIComponent | ||
The event handler called for a keyDown event. | UIComponent | ||
The event handler called for a keyUp event. | UIComponent | ||
Positions the children for this skin. | MobileSkin | ||
Calculates the default size, and optionally the default minimum size,
of the component. | UIComponent | ||
This method is called when a UIComponent is constructed,
and again whenever the ResourceManager dispatches
a "change" Event to indicate
that the localized resources have changed in some way. | UIComponent | ||
A helper method to position children elements of this component. | MobileSkin | ||
A helper method to size children elements of this component. | MobileSkin | ||
Specifies a transform stretch factor in the horizontal and vertical direction. | UIComponent | ||
This method is called when a state changes to check whether
state-specific styles apply to this component. | UIComponent | ||
Draws the object and/or sizes and positions its children. | UIComponent |
樣式可分為一般樣式及與特定主題關聯的樣式兩種。如果是一般樣式,可以與任何主題搭配使用。如果是與特定主題關聯的樣式,只有在您的應用程式使用特定主題時才能使用該樣式。
applicationDPI | 屬性 |
focusSkinExclusions | 屬性 |
focusSkinExclusions:Array
[唯讀] 語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 2.5 |
List of IDs of items that should be excluded when rendering the focus ring. Only items of type DisplayObject or GraphicElement should be excluded. Items of other types are ignored.
實作
protected function get focusSkinExclusions():Array
measuredDefaultHeight | 屬性 |
protected var measuredDefaultHeight:Number = 0
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 2.5 |
Specifies a default height. measuredHeight
returns this value
when the computed measuredHeight
is less than
measuredDefaultHeight
.
預設值為 0。
measuredDefaultWidth | 屬性 |
protected var measuredDefaultWidth:Number = 0
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 2.5 |
Specifies a default width. measuredWidth
returns this value
when the computed measuredWidth
is less than
measuredDefaultWidth
.
預設值為 0。
symbolItems | 屬性 |
useSymbolColor | 屬性 |
protected var useSymbolColor:Boolean = false
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 2.5 |
Specifies whether or not this skin should be affected by the symbolColor
style.
預設值為 false。
MobileSkin | () | 建構函式 |
public function MobileSkin()
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 2.5 |
Constructor.
applyColorTransform | () | 方法 |
protected function applyColorTransform(displayObject:DisplayObject, originalColor:uint, tintColor:uint):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 2.5 |
A helper method to set a color transform on a DisplayObject.
參數
displayObject:DisplayObject — The display object to transform
| |
originalColor:uint — The original color
| |
tintColor:uint — The desired color
|
beginHighlightBitmapCapture | () | 方法 |
public function beginHighlightBitmapCapture():Boolean
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 2.5 |
Called before a bitmap capture is made for this skin. The default implementation excludes items in the focusSkinExclusions array.
傳回值Boolean — true if the component needs to be redrawn; otherwise false .
|
commitCurrentState | () | 方法 |
protected function commitCurrentState():void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 2.5 |
Called whenever the currentState changes. Skins should override this function if they make any appearance changes during a state change.
drawBackground | () | 方法 |
protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 2.5 |
Renders a background for the skin.
This method, along with layoutContents()
, is called
by the updateDisplayList()
.
This method draws the background chromeColor. Override this method to change the appearance of the chromeColor.
參數
unscaledWidth:Number — Specifies the width of the component, in pixels,
in the component's coordinates, regardless of the value of the
scaleX property of the component.
| |
unscaledHeight:Number — Specifies the height of the component, in pixels,
in the component's coordinates, regardless of the value of the
scaleY property of the component.
|
endHighlightBitmapCapture | () | 方法 |
public function endHighlightBitmapCapture():Boolean
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 2.5 |
Called after a bitmap capture is made for this skin. The default implementation restores the items in the focusSkinExclusions array.
傳回值Boolean — true if the component needs to be redrawn; otherwise false .
|
getElementPreferredHeight | () | 方法 |
protected function getElementPreferredHeight(element:Object):Number
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10.1, AIR 2.5 |
A helper method to retrieve the preferred height of a child element.
This method is the recommended way to get a child element's preferred height. You can use this method instead of checking for and using various interfaces/classes such as ILayoutElement, IFlexDisplayObject, or StyleableTextField.
參數
element:Object — The child element to retrieve the height for. The element could
be an ILayoutElement, IFlexDisplayObject, StyleableTextField, or a generic
DisplayObject.
|
Number — The child element's preferred height.
|
相關 API 元素
getElementPreferredWidth | () | 方法 |
protected function getElementPreferredWidth(element:Object):Number
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10.1, AIR 2.5 |
A helper method to retrieve the preferred width of a child element.
This method is the recommended way to get a child element's preferred width. You can use this method instead of checking for and using various interfaces/classes such as ILayoutElement, IFlexDisplayObject, or StyleableTextField.
參數
element:Object — The child element to retrieve the width for. The element could
be an ILayoutElement, IFlexDisplayObject, StyleableTextField, or a generic
DisplayObject.
|
Number — The child element's preferred width.
|
相關 API 元素
hasState | () | 方法 |
override public function hasState(stateName:String):Boolean
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10, AIR 2.5 |
MobileSkin does not use states. Skins should override this function to return false for states that are not implemented.
參數
stateName:String — The state name.
|
Boolean — false for states that are not implemented.
|
layoutContents | () | 方法 |
protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10.1, AIR 2.5 |
Positions the children for this skin.
This method, along with colorizeContents()
, is called
by the updateDisplayList()
method.
This method positions skin parts and graphic children of the skin. Subclasses should override this to position their children.
參數
unscaledWidth:Number — Specifies the width of the component, in pixels,
in the component's coordinates, regardless of the value of the
scaleX property of the component.
| |
unscaledHeight:Number — Specifies the height of the component, in pixels,
in the component's coordinates, regardless of the value of the
scaleY property of the component.
|
setElementPosition | () | 方法 |
protected function setElementPosition(element:Object, x:Number, y:Number):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10.1, AIR 2.5 |
A helper method to position children elements of this component.
This method is the recommended way to position children elements. You can use this method instead of checking for and using various interfaces/classes such as ILayoutElement, IFlexDisplayObject, or StyleableTextField.
Call this method after calling setElementSize()
參數
element:Object — The child element to position. The element could be an
ILayoutElement, IFlexDisplayObject, StyleableTextField, or a generic
DisplayObject.
| |
x:Number — The x-coordinate of the child.
| |
y:Number — The y-coordinate of the child.
|
相關 API 元素
setElementSize | () | 方法 |
protected function setElementSize(element:Object, width:Number, height:Number):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | Flash Player 10.1, AIR 2.5 |
A helper method to size children elements of this component.
This method is the recommended way to size children elements. You can use this method instead of checking for and using interfaces/classes such as ILayoutElement, IFlexDisplayObject, or StyleableTextField.
Call this method before calling the setElementPosition()
method.
參數
element:Object — The child element to size. The element could be an
ILayoutElement, IFlexDisplayObject, StyleableTextField, or a generic
DisplayObject.
| |
width:Number — The width of the child.
| |
height:Number — The height of the child.
|
相關 API 元素
Tue Jun 12 2018, 03:47 PM Z