套件 | mx.core |
介面 | public interface ITextInput extends IDataRenderer , IDropInListItemRenderer , IFocusManagerComponent , IFontContextComponent , IIMESupport , IListItemRenderer , IUIComponent , IInvalidating , IStyleClient , IEventDispatcher , IFlexDisplayObject , ILayoutManagerClient , ISimpleStyleClient , IFlexDisplayObject , ISimpleStyleClient , IBitmapDrawable |
實作者 | MXFTETextInput, TextInput |
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
屬性 | 定義自 | ||
---|---|---|---|
accessibilityProperties : AccessibilityProperties
此顯示物件的目前輔助功能選項。 | IFlexDisplayObject | ||
alpha : Number
指出所指定物件的 Alpha 透明度值。 | IFlexDisplayObject | ||
baselinePosition : Number [唯讀]
The y-coordinate of the baseline
of the first line of text of the component. | IUIComponent | ||
blendMode : String
來自 BlendMode 類別的值,會指定要使用何種混合模式。 | IFlexDisplayObject | ||
cacheAsBitmap : Boolean
如果設定為 true,Flash 執行階段會快取顯示物件的內部點陣圖表示法。 | IFlexDisplayObject | ||
className : String [唯讀]
The name of the component class. | IStyleClient | ||
data : Object
The data to render or edit. | IDataRenderer | ||
document : Object
A reference to the document object associated with this component. | IUIComponent | ||
editable : Boolean
Indicates whether the user is allowed to edit the text in this control. | ITextInput | ||
enabled : Boolean
Whether the component can accept user interaction. | IUIComponent | ||
enableIME : Boolean [唯讀]
Specifies whether the IME should be enabled when
this component has focus. | IIMESupport | ||
explicitHeight : Number
The explicitly specified height for the component,
in pixels, as the component's coordinates. | IUIComponent | ||
explicitMaxHeight : Number [唯讀]
Number that specifies the maximum height of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
explicitMaxWidth : Number [唯讀]
Number that specifies the maximum width of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
explicitMinHeight : Number [唯讀]
Number that specifies the minimum height of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
explicitMinWidth : Number [唯讀]
Number that specifies the minimum width of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
explicitWidth : Number
The explicitly specified width for the component,
in pixels, as the component's coordinates. | IUIComponent | ||
filters : Array
索引的陣列,其中包含目前和顯示物件相關的每個濾鏡物件。 | IFlexDisplayObject | ||
focusEnabled : Boolean
A flag that indicates whether the component can receive focus when selected. | IFocusManagerComponent | ||
focusPane : Sprite
A single Sprite object that is shared among components
and used as an overlay for drawing the focus indicator. | IUIComponent | ||
fontContext : IFlexModuleFactory
The module factory that provides the font context for this component. | IFontContextComponent | ||
hasFocusableChildren : Boolean
A flag that indicates whether child objects can receive focus. | IFocusManagerComponent | ||
height : Number
會指出顯示物件的高度,以像素為單位。 | IFlexDisplayObject | ||
horizontalScrollPosition : Number
Pixel position in the content area of the leftmost pixel
that is currently displayed. | ITextInput | ||
imeMode : String
The IME mode of the component. | IIMESupport | ||
includeInLayout : Boolean
Specifies whether this component is included in the layout of the
parent container. | IUIComponent | ||
inheritingStyles : Object
An object containing the inheritable styles for this component. | IStyleClient | ||
initialized : Boolean
A flag that determines if an object has been through all three phases
of layout validation (provided that any were required)
This flag should only be modified by the LayoutManager. | ILayoutManagerClient | ||
isPopUp : Boolean
Set to true by the PopUpManager to indicate
that component has been popped up. | IUIComponent | ||
listData : BaseListData
Implements the listData property
using setter and getter methods. | IDropInListItemRenderer | ||
loaderInfo : LoaderInfo [唯讀]
會傳回 LoaderInfo 物件,其中包含關於載入此顯示物件所屬之檔案的資訊。 | IFlexDisplayObject | ||
mask : DisplayObject
呼叫之顯示物件會以指定的 mask 物件遮蓋。 | IFlexDisplayObject | ||
maxChars : int
Maximum number of characters that users can enter in the text field. | ITextInput | ||
maxHeight : Number [唯讀]
Number that specifies the maximum height of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
maxWidth : Number [唯讀]
Number that specifies the maximum width of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
measuredHeight : Number [唯讀]
The measured height of this object. | IFlexDisplayObject | ||
measuredMinHeight : Number
The default minimum height of the component, in pixels. | IUIComponent | ||
measuredMinWidth : Number
The default minimum width of the component, in pixels. | IUIComponent | ||
measuredWidth : Number [唯讀]
The measured width of this object. | IFlexDisplayObject | ||
minHeight : Number [唯讀]
Number that specifies the minimum height of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
minWidth : Number [唯讀]
Number that specifies the minimum width of the component,
in pixels, as the component's coordinates. | IUIComponent | ||
mouseChildren : Boolean
判斷物件的子系是否支援啟用滑鼠或使用者輸入裝置。 | ITextInput | ||
mouseEnabled : Boolean
指定此物件是否接收滑鼠或其他使用者輸入及訊息。 | ITextInput | ||
mouseFocusEnabled : Boolean [唯讀]
A flag that indicates whether the component can receive focus
when selected with the mouse. | IFocusManagerComponent | ||
mouseX : Number [唯讀]
指出滑鼠或使用者輸入裝置位置的 x 座標,以像素為單位。 | IFlexDisplayObject | ||
mouseY : Number [唯讀]
指出滑鼠或使用者輸入裝置位置的 y 座標,以像素為單位。 | IFlexDisplayObject | ||
name : String
指出 DisplayObject 的實體名稱。 | IFlexDisplayObject | ||
nestLevel : int
The top-level SystemManager has a nestLevel of 1. | ILayoutManagerClient | ||
nonInheritingStyles : Object
An object containing the noninheritable styles for this component. | IStyleClient | ||
opaqueBackground : Object
會指定顯示物件是否不透明,並具有特定背景顏色。 | IFlexDisplayObject | ||
owner : DisplayObjectContainer
The owner of this IVisualElement object. | IUIComponent | ||
parent : DisplayObjectContainer [唯讀]
指出包含此顯示物件的 DisplayObjectContainer 物件。 | IFlexDisplayObject | ||
parentDrawsFocus : Boolean
If true, calls to this control's drawFocus() method are forwarded
to its parent's drawFocus() method. | ITextInput | ||
percentHeight : Number
Number that specifies the height of a component as a
percentage of its parent's size. | IUIComponent | ||
percentWidth : Number
Number that specifies the width of a component as a
percentage of its parent's size. | IUIComponent | ||
processedDescriptors : Boolean
Set to true after immediate or deferred child creation,
depending on which one happens. | ILayoutManagerClient | ||
restrict : String
Indicates the set of characters that a user can enter into the control. | ITextInput | ||
root : DisplayObject [唯讀]
對載入之 SWF 檔案的顯示物件而言,root 屬性就是該 SWF 檔案所呈現之顯示清單樹狀結構部分的最上層顯示物件。 | IFlexDisplayObject | ||
rotation : Number
指出 DisplayObject 實體的旋轉度數 (從該物件原本方向算起)。 | IFlexDisplayObject | ||
scale9Grid : Rectangle
目前產生效用的縮放格線。 | IFlexDisplayObject | ||
scaleX : Number
指出從註冊點套用的物件水平縮放 (百分比)。 | IFlexDisplayObject | ||
scaleY : Number
指出從物件註冊點套用的物件垂直縮放 (百分比)。 | IFlexDisplayObject | ||
scrollRect : Rectangle
顯示物件的捲動矩形範圍。 | IFlexDisplayObject | ||
selectable : Boolean
A flag indicating whether the text in the TextInput can be selected. | ITextInput | ||
selectionActivePosition : int [唯讀]
The zero-based index of the position after the last character
in the current selection (equivalent to the one-based index of the last
character). | ITextInput | ||
selectionAnchorPosition : int [唯讀]
The zero-based character index value of the first character
in the current selection. | ITextInput | ||
stage : Stage [唯讀]
顯示物件的「舞台」。 | IFlexDisplayObject | ||
styleDeclaration : CSSStyleDeclaration
The style declaration that holds the inline styles declared by this
object. | IStyleClient | ||
styleName : Object
The source of this object's style values. | ISimpleStyleClient | ||
systemManager : ISystemManager
A reference to the SystemManager object for this component. | IUIComponent | ||
tabFocusEnabled : Boolean [唯讀]
A flag that indicates whether pressing the Tab key eventually
moves focus to this component. | IFocusManagerComponent | ||
tabIndex : int
If tabFocusEnabled, the order in which the component receives focus. | IFocusManagerComponent | ||
text : String
Plain text that appears in the control. | ITextInput | ||
transform : flash.geom:Transform
這是一個物件,具有和顯示物件的矩陣、顏色轉換和像素邊界有關的屬性。 | IFlexDisplayObject | ||
tweeningProperties : Array
Used by EffectManager. | IUIComponent | ||
updateCompletePendingFlag : Boolean
A flag that determines if an object is waiting to have its
updateComplete event dispatched. | ILayoutManagerClient | ||
visible : Boolean
不管是否看得見顯示物件。 | IFlexDisplayObject | ||
width : Number
會指出顯示物件的寬度,以像素為單位。 | IFlexDisplayObject | ||
x : Number
指出 DisplayObject 實體相對於父輩 DisplayObjectContainer 之區域座標的 x 座標。 | IFlexDisplayObject | ||
y : Number
指出 DisplayObject 實體相對於父輩 DisplayObjectContainer 之區域座標的 y 座標。 | IFlexDisplayObject |
方法 | 定義自 | ||
---|---|---|---|
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。 | IEventDispatcher | ||
Deletes a style property from this component instance. | IStyleClient | ||
會將事件傳送到事件流程。 | IEventDispatcher | ||
Called by the FocusManager when the component receives focus. | IFocusManagerComponent | ||
傳回可定義顯示物件區域 (相對於 targetCoordinateSpace 物件的座標系統) 的矩形。 | IFlexDisplayObject | ||
Returns an Array of CSSStyleDeclaration objects for the type selector
that applies to this component, or null if none exist. | IStyleClient | ||
A convenience method for determining whether to use the
explicit or measured height
| IUIComponent | ||
A convenience method for determining whether to use the
explicit or measured width
| IUIComponent | ||
根據 targetCoordinateSpace 參數所定義的座標系統,並排除形狀上的任何筆畫,傳回可定義顯示物件邊界的矩形。 | IFlexDisplayObject | ||
Gets a style property that has been set anywhere in this
component's style lookup chain. | IStyleClient | ||
將 point 物件從「舞台」(全域) 座標轉換成顯示物件的 (區域) 座標。 | IFlexDisplayObject | ||
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | IEventDispatcher | ||
評估顯示物件的範圍框,看它是否與 obj 顯示物件的範圍框重疊或相交。 | IFlexDisplayObject | ||
評估顯示物件,看它是否與 x 和 y 參數所指定的點重疊或相交。 | IFlexDisplayObject | ||
Initialize the object. | IUIComponent | ||
Calling this method results in a call to the component's
validateDisplayList() method
before the display list is rendered. | IInvalidating | ||
Calling this method results in a call to the component's
validateProperties() method
before the display list is rendered. | IInvalidating | ||
Calling this method results in a call to the component's
validateSize() method
before the display list is rendered. | IInvalidating | ||
將 point 物件從顯示物件的 (區域) 座標轉換成「舞台」(全域) 座標。 | IFlexDisplayObject | ||
Moves this object to the specified x and y coordinates. | IFlexDisplayObject | ||
Propagates style changes to the children of this component. | IStyleClient | ||
Returns true if the chain of owner properties
points from child to this UIComponent. | IUIComponent | ||
Called by Flex when a UIComponent object is added to or removed from a parent. | IUIComponent | ||
Sets up the internal style cache values so that the getStyle()
method functions. | IStyleClient | ||
Registers the EffectManager as one of the event listeners for each effect event. | IStyleClient | ||
會從 EventDispatcher 物件移除偵聽程式。 | IEventDispatcher | ||
Selects the text in the range specified by the parameters. | ITextInput | ||
Sets the actual size of this object. | IFlexDisplayObject | ||
Called by the FocusManager when the component receives focus. | IFocusManagerComponent | ||
Sets a style property on this component instance. | IStyleClient | ||
Called when the visible property changes. | IUIComponent | ||
Determines whether the border and background of the TextInput are
visible. | ITextInput | ||
Called when the value of a style property is changed. | ISimpleStyleClient | ||
Validates the position and size of children and draws other
visuals. | ILayoutManagerClient | ||
Validates and updates the properties and layout of this object
by immediately calling validateProperties(),
validateSize(), and validateDisplayList(),
if necessary. | IInvalidating | ||
Validates the properties of a component. | ILayoutManagerClient | ||
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. | ILayoutManagerClient | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | IEventDispatcher |
editable | 屬性 |
horizontalScrollPosition | 屬性 |
horizontalScrollPosition:Number
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Pixel position in the content area of the leftmost pixel
that is currently displayed.
(The content area includes all contents of a control, not just
the portion that is currently displayed.)
This property is always set to 0, and ignores changes,
if wordWrap
is set to true
.
預設值為 0。
實作
public function get horizontalScrollPosition():Number
public function set horizontalScrollPosition(value:Number):void
maxChars | 屬性 |
maxChars:int
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Maximum number of characters that users can enter in the text field.
This property does not limit the length of text specified by the
setting the control's text
or htmlText
property.
The default value is 0, which is a special case meaning an unlimited number.
實作
public function get maxChars():int
public function set maxChars(value:int):void
mouseChildren | 屬性 |
mouseChildren:Boolean
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
判斷物件的子系是否支援啟用滑鼠或使用者輸入裝置。如果啟用某個物件,則使用者可以使用滑鼠或使用者輸入裝置,與其進行互動。預設值為 true
。
當您使用 Sprite 類別 (而不是使用 SimpleButton 類別) 來建立按鈕時,這個方法就會很有用。 當您使用 Sprite 實體來建立按鈕時,可以選擇使用 addChild()
方法加入額外的 Sprite 實體來裝飾按鈕。 此程序可能會造成未預期的滑鼠事件行為,因為當做子系加入的 Sprite 實體可能會在您預期父輩實體將成為目標物件時,成為滑鼠事件的目標物件。 為了確保父輩實體能夠當作滑鼠事件的目標物件來運作,可以將父輩實體的 mouseChildren
屬性設為 false
。
設定這個屬性不會傳送任何事件。 您必須使用 addEventListener()
方法來建立互動式功能。
實作
public function get mouseChildren():Boolean
public function set mouseChildren(value:Boolean):void
mouseEnabled | 屬性 |
mouseEnabled:Boolean
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
指定此物件是否接收滑鼠或其他使用者輸入及訊息。預設值為 true
,也就是說,任何位於顯示清單上的 InteractiveObject 實體,依預設都會接收滑鼠事件或其他使用者輸入事件。如果 mouseEnabled
設定成 false
,則此實體不會接收任何滑鼠事件 (或其他使用者輸入事件,例如鍵盤事件)。在顯示清單上,此實體的任何子系都不會受到影響。 若要變更顯示清單上某個物件的所有子系之 mouseEnabled
行為指令,請使用 flash.display.DisplayObjectContainer.mouseChildren
。
設定這個屬性不會傳送任何事件。 您必須使用 addEventListener()
方法來建立互動式功能。
實作
public function get mouseEnabled():Boolean
public function set mouseEnabled(value:Boolean):void
parentDrawsFocus | 屬性 |
parentDrawsFocus:Boolean
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
If true, calls to this control's drawFocus()
method are forwarded
to its parent's drawFocus()
method.
This is used when a TextInput is part of a composite control
like NumericStepper or ComboBox;
預設值為 false。
實作
public function get parentDrawsFocus():Boolean
public function set parentDrawsFocus(value:Boolean):void
restrict | 屬性 |
restrict:String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Indicates the set of characters that a user can enter into the control.
If the value of the restrict
property is null
,
you can enter any character. If the value of the restrict
property is an empty string, you cannot enter any character.
This property only restricts user interaction; a script
can put any text into the text field. If the value of
the restrict
property is a string of characters,
you may enter only characters in that string into the
text field.
Flex scans the string from left to right. You can specify a range by using the hyphen (-) character. If the string begins with a caret (^) character, all characters are initially accepted and succeeding characters in the string are excluded from the set of accepted characters. If the string does not begin with a caret (^) character, no characters are initially accepted and succeeding characters in the string are included in the set of accepted characters.
Because some characters have a special meaning when used
in the restrict
property, you must use
backslash characters to specify the literal characters -, ^, and \.
When you use the restrict
property as an attribute
in an MXML tag, use single backslashes, as in the following
example: \^\-\\.
When you set the restrict
In and ActionScript expression,
use double backslashes, as in the following example: \\^\\-\\\.
預設值為 null。
實作
public function get restrict():String
public function set restrict(value:String):void
相關 API 元素
selectable | 屬性 |
selectionActivePosition | 屬性 |
selectionActivePosition:int
[唯讀] 語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
The zero-based index of the position after the last character
in the current selection (equivalent to the one-based index of the last
character).
If the last character in the selection, for example, is the fifth
character, this property has the value 5.
When the control gets the focus, the selection is visible if the
selectionAnchorIndex
and selectionActiveIndex
properties are both set.
預設值為 0。
實作
public function get selectionActivePosition():int
selectionAnchorPosition | 屬性 |
selectionAnchorPosition:int
[唯讀] 語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
The zero-based character index value of the first character
in the current selection.
For example, the first character is 0, the second character is 1,
and so on.
When the control gets the focus, the selection is visible if the
selectionAnchorIndex
and selectionActiveIndex
properties are both set.
預設值為 0。
實作
public function get selectionAnchorPosition():int
text | 屬性 |
text:String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Plain text that appears in the control. Its appearance is determined by the CSS styles of this Label control.
Any HTML tags in the text string are ignored,
and appear as entered in the string.
To display text formatted using HTML tags,
use the htmlText
property instead.
If you set the htmlText
property,
the HTML replaces any text you had set using this propety, and the
text
property returns a plain-text version of the
HTML text, with all HTML tags stripped out. For more information
see the htmlText
property.
To include the special characters left angle bracket (<),
right angle bracket (>), or ampersand (&) in the text,
wrap the text string in the CDATA tag.
Alternatively, you can use HTML character entities for the
special characters, for example, <
.
If you try to set this property to null
,
it is set, instead, to the empty string.
The text
property can temporarily have the value null
,
which indicates that the htmlText
has been recently set
and the corresponding text
value
has not yet been determined.
預設值為 ""。
實作
public function get text():String
public function set text(value:String):void
selectRange | () | 方法 |
public function selectRange(anchorPosition:int, activePosition:int):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Selects the text in the range specified by the parameters.
參數
anchorPosition:int — The zero-based character index value
of the first character in the current selection.
| |
activePosition:int — The zero-based index of the position
after the last character in the current selection
(equivalent to the one-based index of the last character).
|
showBorderAndBackground | () | 方法 |
Tue Jun 12 2018, 03:47 PM Z