套件 | spark.components.supportClasses |
類別 | public class StyleableTextField |
繼承 | StyleableTextField FlexTextField TextField InteractiveObject DisplayObject EventDispatcher Object |
實作 | IEditableText, ISimpleStyleClient, IVisualElement |
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
更多範例
屬性 | 定義自 | ||
---|---|---|---|
accessibilityImplementation : AccessibilityImplementation
對此 InteractiveObject 實體目前的輔助功能實作 (AccessibilityImplementation)。 | InteractiveObject | ||
accessibilityProperties : AccessibilityProperties
此顯示物件的目前輔助功能選項。 | DisplayObject | ||
alpha : Number
指出所指定物件的 Alpha 透明度值。 | DisplayObject | ||
alwaysShowSelection : Boolean
當設定為 true 而且文字欄位不在焦點中時,Flash Player 便會將文字欄位中的選取範圍反白標示為灰色。 | TextField | ||
antiAliasType : String
對此文字欄位使用的消除鋸齒類型。 | TextField | ||
autoSize : String
控制文字欄位的自動調整大小和對齊方式。 | TextField | ||
background : Boolean
會指定文字欄位是否具有背景填色。 | TextField | ||
backgroundColor : uint
文字欄位背景的顏色。 | TextField | ||
blendMode : String
來自 BlendMode 類別的值,會指定要使用何種混合模式。 | DisplayObject | ||
blendShader : Shader [唯寫]
設定用來混合前景和背景的著色器。 | DisplayObject | ||
border : Boolean
會指定文字欄位是否具有邊框。 | TextField | ||
borderColor : uint
文字欄位邊框的顏色。 | TextField | ||
bottomScrollV : int [唯讀]
整數 (從 1 開始的索引),指出目前在指定之文字欄位中,可以看見的最底端字行。 | TextField | ||
cacheAsBitmap : Boolean
如果設定為 true,Flash 執行階段會快取顯示物件的內部點陣圖表示法。 | DisplayObject | ||
cacheAsBitmapMatrix : Matrix
如果為非 null,當 cacheAsBitmap 設定為 true 時,這個 Matrix 物件會定義顯示物件的顯示方法。 | DisplayObject | ||
caretIndex : int [唯讀]
插入點 (跳脫字元) 位置的索引。 | TextField | ||
condenseWhite : Boolean
Boolean 值,指定在具有 HTML 文字的文字欄位中,是否移除額外的空白字元 (空格、斷行符號等等)。 | TextField | ||
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | ||
contextMenu : NativeMenu
指定與此物件有關聯的快顯選單。 | InteractiveObject | ||
defaultTextFormat : flash.text:TextFormat
指定套用至新插入之文字 (例如,使用者所輸入的文字,或是以 replaceSelectedText() 方法插入的文字) 的格式。 | TextField | ||
displayAsPassword : Boolean
指定文字欄位是否為密碼文字欄位。 | TextField | ||
doubleClickEnabled : Boolean
會指定物件是否會收到 doubleClick 事件。 | InteractiveObject | ||
editable : Boolean
Specifies whether the text is editable, true,
or not, false. | StyleableTextField | ||
embedFonts : Boolean
會指定是否要使用內嵌的字體外框顯示。 | TextField | ||
enabled : Boolean
Whether the component can accept user interaction. | StyleableTextField | ||
filters : Array
索引的陣列,其中包含目前和顯示物件相關的每個濾鏡物件。 | DisplayObject | ||
focusEnabled : Boolean
Indicates whether the component can receive focus when tabbed to. | StyleableTextField | ||
focusRect : Object
會指定這個物件是否會顯示焦點矩形。 | InteractiveObject | ||
gridFitType : String
對此文字欄位使用的格線符合類型。 | TextField | ||
height : Number
會指出顯示物件的高度,以像素為單位。 | DisplayObject | ||
horizontalScrollPosition : Number
The horizontal scroll position of the text. | StyleableTextField | ||
htmlText : String
包含 HTML 表示方式的文字欄位內容。 | TextField | ||
isTruncated : Boolean [唯讀]
Indicates whether the text has been truncated, true,
or not, false. | StyleableTextField | ||
length : int [唯讀]
文字欄位中的字元數。 | TextField | ||
lineBreak : String
Controls word wrapping within the text. | StyleableTextField | ||
loaderInfo : LoaderInfo [唯讀]
會傳回 LoaderInfo 物件,其中包含關於載入此顯示物件所屬之檔案的資訊。 | DisplayObject | ||
mask : DisplayObject
呼叫之顯示物件會以指定的 mask 物件遮蓋。 | DisplayObject | ||
maxChars : int
文字欄位可以包含的最大字元數,也就是使用者可輸入的字元數。 | TextField | ||
maxScrollH : int [唯讀]
scrollH 的最大值。 | TextField | ||
maxScrollV : int [唯讀]
scrollV 的最大值。 | TextField | ||
metaData : Object
如果中繼資料是透過 PlaceObject4 標籤與 SWF 檔案中的這個 DisplayObject 實體一同儲存,則會取得 DisplayObject 實體的中繼資料物件。 | DisplayObject | ||
minHeight : Number
The minimum recommended height of the component to be considered
by the parent during layout. | StyleableTextField | ||
minWidth : Number
The minimum recommended width of the component to be considered
by the parent during layout. | StyleableTextField | ||
mouseEnabled : Boolean
指定此物件是否接收滑鼠或其他使用者輸入及訊息。 | InteractiveObject | ||
mouseWheelEnabled : Boolean
Boolean 值,指出當使用者按一下文字欄位並滾動滑鼠滾輪時,Flash Player 是否會自動捲動多行文字欄位。 | TextField | ||
mouseX : Number [唯讀]
指出滑鼠或使用者輸入裝置位置的 x 座標,以像素為單位。 | DisplayObject | ||
mouseY : Number [唯讀]
指出滑鼠或使用者輸入裝置位置的 y 座標,以像素為單位。 | DisplayObject | ||
multiline : Boolean
指出欄位是否為多行文字欄位。 | TextField | ||
name : String
指出 DisplayObject 的實體名稱。 | DisplayObject | ||
needsSoftKeyboard : Boolean
指定虛擬鍵盤 (螢幕上的軟體鍵盤) 是否應在此 InteractiveObject 實體接收到焦點時顯示。 | InteractiveObject | ||
numLines : int [唯讀]
會定義多行文字欄位中的文字行數。 | TextField | ||
opaqueBackground : Object
會指定顯示物件是否不透明,並具有特定背景顏色。 | DisplayObject | ||
parent : DisplayObjectContainer [唯讀]
指出包含此顯示物件的 DisplayObjectContainer 物件。 | DisplayObject | ||
restrict : String
指出使用者能夠輸入文字欄位中的字元組。 | TextField | ||
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 | ||
scrollH : int
目前的水平捲動位置。 | TextField | ||
scrollRect : Rectangle
顯示物件的捲動矩形範圍。 | DisplayObject | ||
scrollV : int
文字欄位中文字的垂直位置。 | TextField | ||
selectable : Boolean
指出文字欄位是否可選取的 Boolean 值。 | TextField | ||
selectionActivePosition : int [唯讀]
The active, or last clicked position, of the selection. | StyleableTextField | ||
selectionAnchorPosition : int [唯讀]
The anchor, or first clicked position, of the selection. | StyleableTextField | ||
selectionBeginIndex : int [唯讀]
目前選取範圍中,第一個字元的字元索引值 (從零開始)。 | TextField | ||
selectionEndIndex : int [唯讀]
目前選取範圍中,最後一個字元的字元索引值 (從零開始)。 | TextField | ||
sharpness : Number
在這個文字欄位中,文字邊緣的清晰度。 | TextField | ||
softKeyboard : String
控制軟體鍵盤的外觀。 | InteractiveObject | ||
softKeyboardInputAreaOfInterest : Rectangle
定義顯示軟體鍵盤時,應保留於螢幕上的區域 (iOS 未提供)。 | InteractiveObject | ||
stage : Stage [唯讀]
顯示物件的「舞台」。 | DisplayObject | ||
styleDeclaration : CSSStyleDeclaration
Storage for the inline inheriting styles on this object. | StyleableTextField | ||
styleName : Object
The class style used by this component. | StyleableTextField | ||
styleSheet : StyleSheet
將樣式表附加至文字欄位。 | TextField | ||
tabEnabled : Boolean
會指定這個物件是否在停駐點順序中。 | InteractiveObject | ||
tabIndex : int
會指定 SWF 檔中的物件停駐點順序。 | InteractiveObject | ||
text : String [覆寫]
The text displayed by this text component. | StyleableTextField | ||
textColor : uint
文字欄位中文字的顏色,以十六進位格式表示。 | TextField | ||
textHeight : Number [唯讀]
文字的高度,以像素為單位。 | TextField | ||
textInteractionMode : String [唯讀]
互動模式屬性,預設值為 TextInteractionMode.NORMAL。 | TextField | ||
textWidth : Number [唯讀]
文字的寬度,以像素為單位。 | TextField | ||
thickness : Number
在這個文字欄位中,字符邊緣的粗細。 | TextField | ||
transform : flash.geom:Transform
這是一個物件,具有和顯示物件的矩陣、顏色轉換和像素邊界有關的屬性。 | DisplayObject | ||
type : String
文字欄位的類型。 | TextField | ||
useRichTextClipboard : Boolean
會指定文字格式是否隨著文字一起複製和貼上。 | TextField | ||
verticalScrollPosition : Number
The vertical scroll position of the text. | StyleableTextField | ||
visible : Boolean
不管是否看得見顯示物件。 | DisplayObject | ||
width : Number
會指出顯示物件的寬度,以像素為單位。 | DisplayObject | ||
wordWrap : Boolean
指出文字欄位是否具有文字換行功能的 Boolean 值。 | TextField | ||
x : Number
指出 DisplayObject 實體相對於父輩 DisplayObjectContainer 之區域座標的 x 座標。 | DisplayObject | ||
y : Number
指出 DisplayObject 實體相對於父輩 DisplayObjectContainer 之區域座標的 y 座標。 | DisplayObject | ||
z : Number
表示 DisplayObject 實體相對於 3D 父輩容器的 z 座標位置 (沿著 z 軸)。 | DisplayObject |
方法 | 定義自 | ||
---|---|---|---|
Constructor. | StyleableTextField | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。 | EventDispatcher | ||
[覆寫]
Appends the specified text to the end of the text component,
as if you had clicked at the end and typed. | StyleableTextField | ||
Commit the styles into the TextField. | StyleableTextField | ||
會將事件傳送到事件流程。 | EventDispatcher | ||
傳回可定義顯示物件區域 (相對於 targetCoordinateSpace 物件的座標系統) 的矩形。 | DisplayObject | ||
會傳回做為字元之範圍框的矩形。 | TextField | ||
會在 x 和 y 參數所指定的點,傳回字元的索引值 (從零開始)。 | TextField | ||
指定字元索引,會傳回相同段落中第一個字元的索引。 | TextField | ||
對於使用 <img> 標籤新增至 HTML 格式之文字欄位的影像或 SWF 檔,傳回指定之 id 的 DisplayObject 參考。 | TextField | ||
會在 x 和 y 參數所指定的點,傳回字行的索引值 (從零開始)。 | TextField | ||
會傳回字行的索引值 (從零開始),該字行包含 charIndex 參數所指定的字元。 | TextField | ||
會傳回特定文字行中的字元數。 | TextField | ||
會傳回關於指定之文字行的公制字資訊。 | TextField | ||
會傳回 lineIndex 參數所指定之字行中,第一個字元的字元索引。 | TextField | ||
會傳回 lineIndex 參數所指定之字行的文字。 | TextField | ||
指定字元索引,會傳回包含指定之字元的段落長度。 | TextField | ||
根據 targetCoordinateSpace 參數所定義的座標系統,並排除形狀上的任何筆畫,傳回可定義顯示物件邊界的矩形。 | DisplayObject | ||
Gets a style property that has been set anywhere in this
component's style lookup chain. | StyleableTextField | ||
會傳回 TextFormat 物件,包含 beginIndex 和 endIndex 參數所指定之文字範圍的格式資訊。 | TextField | ||
將 point 物件從「舞台」(全域) 座標轉換成顯示物件的 (區域) 座標。 | DisplayObject | ||
將二維點從「舞台」(全域) 座標轉換為三維顯示物件的 (區域) 座標。 | DisplayObject | ||
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | EventDispatcher | ||
指出物件是否有已定義的指定屬性。 | Object | ||
評估顯示物件的範圍框,看它是否與 obj 顯示物件的範圍框重疊或相交。 | DisplayObject | ||
評估顯示物件,看它是否與 x 和 y 參數所指定的點重疊或相交。 | DisplayObject | ||
Inserts the specified text into the text component
as if you had typed it. | StyleableTextField | ||
[靜態]
如果指定的 fontName 和 fontStyle 提供內嵌字體,而 Font.fontType 為 flash.text.FontType.EMBEDDED 時,則傳回 true。 | TextField | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
將三維顯示物件的 (區域) 座標的三維點轉換為「舞台」(全域) 座標中的二維點。 | DisplayObject | ||
將 point 物件從顯示物件的 (區域) 座標轉換成「舞台」(全域) 座標。 | DisplayObject | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | ||
會以 value 參數的內容取代目前的選取範圍。 | TextField | ||
會以 newText 參數的內容,取代 beginIndex 和 endIndex 參數所指定的字元範圍。 | TextField | ||
升起顯示虛擬鍵盤。 | InteractiveObject | ||
Scroll so the specified range is in view. | StyleableTextField | ||
Selects all of the text. | StyleableTextField | ||
Selects a specified range of characters. | StyleableTextField | ||
Set focus to this text field. | StyleableTextField | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
根據第一個和最後一個字元指定的索引值 (以 beginIndex 和 endIndex 參數指定),設定選取文字。 | TextField | ||
Sets a style property on this component instance. | StyleableTextField | ||
會將 format 參數所指定的文字格式,套用至文字欄位中的指定文字。 | TextField | ||
Detects changes to style properties. | StyleableTextField | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
[覆寫]
Returns a string indicating the location of this object
within the hierarchy of DisplayObjects in the Application. | FlexTextField | ||
Truncate text to make it fit horizontally in the area defined for the control,
and append an ellipsis, three periods (...), to the text. | StyleableTextField | ||
會傳回指定之物件的基本值。 | Object | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher |
樣式可分為一般樣式及與特定主題關聯的樣式兩種。如果是一般樣式,可以與任何主題搭配使用。如果是與特定主題關聯的樣式,只有在您的應用程式使用特定主題時才能使用該樣式。
樣式 | 說明 | 定義自 | ||
---|---|---|---|---|
color | 類型: uint 格式: Color CSS 繼承: 是 語言版本: ActionScript 3.0 產品版本: Flex 4.5 執行階段版本: AIR2.5, Color of text in the component, including the component label. The default value for the Halo theme is 0x0B333C .
The default value for the Spark theme is 0x000000 .
The default value for the Mobile theme is 0xFFFFFF .
| StyleableTextField | ||
fontFamily | 類型: String CSS 繼承: 是 語言版本: ActionScript 3.0 產品版本: Flex 4.5 執行階段版本: AIR2.5, Name of the font to use. Unlike in a full CSS implementation, comma-separated lists are not supported. You can use any font family name. If you specify a generic font name, it is converted to an appropriate device font. The default font for the Halo theme is "Verdana" .
The default font for the Spark theme is "Arial" .
The default font for the Mobile theme is "_sans" .
| StyleableTextField | ||
fontSize | 類型: Number 格式: Length CSS 繼承: 是 語言版本: ActionScript 3.0 產品版本: Flex 4.5 執行階段版本: AIR2.5, Height of the text, in pixels. In the Halo theme, the default value is 10 for all controls except the ColorPicker control. For the Halo themed ColorPicker control, the default value is 11. In the Spark theme, the default value is 12 for all controls except the ColorPicker control. For the Spark themed ColorPicker control, the default value is 11. The default value for the Mobile theme is 24. | StyleableTextField | ||
fontStyle | 類型: String CSS 繼承: 是 語言版本: ActionScript 3.0 產品版本: Flex 4.5 執行階段版本: AIR2.5, Determines whether the text is italic font. Recognized values are "normal" and "italic" .
預設值為 "normal" 。 | StyleableTextField | ||
fontWeight | 類型: String CSS 繼承: 是 語言版本: ActionScript 3.0 產品版本: Flex 4.5 執行階段版本: AIR2.5, Determines whether the text is boldface. Recognized values are normal and bold .
The default value for Button controls is bold .
The default value for all other controls is normal .
| StyleableTextField | ||
leading | 類型: Number 格式: Length CSS 繼承: 是 語言版本: ActionScript 3.0 產品版本: Flex 4.5 執行階段版本: AIR2.5, Additional vertical space between lines of text. The default value is 0. | StyleableTextField | ||
letterSpacing | 類型: Number CSS 繼承: 是 語言版本: ActionScript 3.0 產品版本: Flex 4.5 執行階段版本: AIR2.5, The number of additional pixels to appear between each character. A positive value increases the character spacing beyond the normal spacing, while a negative value decreases it. 預設值為 0 。 | StyleableTextField | ||
textAlign | 類型: String CSS 繼承: 是 語言版本: ActionScript 3.0 產品版本: Flex 4.5 執行階段版本: AIR2.5, Alignment of text within a container. Possible values are "left" , "right" ,
or "center" .
The default value for most components is | StyleableTextField | ||
textDecoration | 類型: String CSS 繼承: 是 語言版本: ActionScript 3.0 產品版本: Flex 4.5 執行階段版本: AIR2.5, Determines whether the text is underlined. Possible values are "none" and "underline" .
預設值為 "none" 。 | StyleableTextField | ||
textIndent | 類型: Number 格式: Length CSS 繼承: 是 語言版本: ActionScript 3.0 產品版本: Flex 4.5 執行階段版本: AIR2.5, Offset of first line of text from the left side of the container, in pixels. This property cannot be a negative number when used with the mobile theme. 預設值為 0 。 | StyleableTextField |
editable | 屬性 |
enabled | 屬性 |
enabled:Boolean
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Whether the component can accept user interaction.
After setting the enabled
property to false
,
some components still respond to mouse interactions such as mouseOver
.
As a result, to fully disable the component, you should also set the value
of the mouseEnabled
property to false
.
實作
public function get enabled():Boolean
public function set enabled(value:Boolean):void
focusEnabled | 屬性 |
focusEnabled:Boolean
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Indicates whether the component can receive focus when tabbed to.
You can set focusEnabled
to false
when a
component is used as a subcomponent of another component so that
the outer component becomes the focusable entity.
If this property is false
, focus is transferred to
the first parent that has focusEnable
set to true
.
預設值為 true。
實作
public function get focusEnabled():Boolean
public function set focusEnabled(value:Boolean):void
horizontalScrollPosition | 屬性 |
isTruncated | 屬性 |
lineBreak | 屬性 |
lineBreak:String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Controls word wrapping within the text.
This property corresponds to the lineBreak
style.
Text may be set to fit the width of the container (LineBreak.TO_FIT
),
or can be set to break only at explicit return or line feed characters (LineBreak.EXPLICIT
).
Legal values are flashx.textLayout.formats.LineBreak.EXPLICIT
,
flashx.textLayout.formats.LineBreak.TO_FIT
, and
flashx.textLayout.formats.FormatValue.INHERIT
.
實作
public function get lineBreak():String
public function set lineBreak(value:String):void
minHeight | 屬性 |
public var minHeight:Number
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
The minimum recommended height of the component to be considered by the parent during layout. This value is in the component's coordinates, in pixels. The default value depends on the component's implementation.
If the application developer sets the value of minHeight, the new value is stored in explicitMinHeight. The default value of minHeight does not change. As a result, at layout time, if minHeight was explicitly set by the application developer, then the value of explicitMinHeight is used for the component's minimum recommended height. If minHeight is not set explicitly by the application developer, then the value of measuredMinHeight is used.
This value is used by the container in calculating
the size and position of the component.
It is not used by the component itself in determining
its default size.
Thus this property may not have any effect if parented by
Container, or containers that don't factor in
this property.
Because the value is in component coordinates,
the true minHeight
with respect to its parent
is affected by the scaleY
property.
minWidth | 屬性 |
public var minWidth:Number
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
The minimum recommended width of the component to be considered by the parent during layout. This value is in the component's coordinates, in pixels. The default value depends on the component's implementation.
If the application developer sets the value of minWidth, the new value is stored in explicitMinWidth. The default value of minWidth does not change. As a result, at layout time, if minWidth was explicitly set by the application developer, then the value of explicitMinWidth is used for the component's minimum recommended width. If minWidth is not set explicitly by the application developer, then the value of measuredMinWidth is used.
This value is used by the container in calculating
the size and position of the component.
It is not used by the component itself in determining
its default size.
Thus this property may not have any effect if parented by
Container, or containers that don't factor in
this property.
Because the value is in component coordinates,
the true minWidth
with respect to its parent
is affected by the scaleX
property.
selectionActivePosition | 屬性 |
selectionAnchorPosition | 屬性 |
styleDeclaration | 屬性 |
styleDeclaration:CSSStyleDeclaration
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Storage for the inline inheriting styles on this object.
This CSSStyleDeclaration is created the first time that
the setStyle()
method
is called on this component to set an inheriting style.
Developers typically never need to access this property directly.
實作
public function get styleDeclaration():CSSStyleDeclaration
public function set styleDeclaration(value:CSSStyleDeclaration):void
styleName | 屬性 |
text | 屬性 |
text:String
[覆寫] 語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
The text displayed by this text component.
The formatting of this text is controlled by CSS styles. The supported styles depend on the subclass.
預設值為 ""。
實作
override public function get text():String
override public function set text(value:String):void
verticalScrollPosition | 屬性 |
StyleableTextField | () | 建構函式 |
public function StyleableTextField()
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Constructor.
appendText | () | 方法 |
override public function appendText(text:String):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Appends the specified text to the end of the text component, as if you had clicked at the end and typed.
An insertion point is then set after the new text. If necessary, the text will scroll to ensure that the insertion point is visible.
參數
text:String — The text to be appended.
|
commitStyles | () | 方法 |
public function commitStyles():void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Commit the styles into the TextField. This method must be called before the text is displayed, and any time the styles have changed. This method does nothing if the styles have already been committed.
getStyle | () | 方法 |
public function getStyle(styleProp:String):*
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Gets a style property that has been set anywhere in this component's style lookup chain.
This same method is used to get any kind of style property, so the value returned can be a Boolean, String, Number, int, uint (for an RGB color), Class (for a skin), or any kind of object. Therefore the return type is simply specified as *.
If you are getting a particular style property, you know its type and often want to store the result in a variable of that type. No casting from * to that type is necessary.
var backgroundColor:uint = getStyle("backgroundColor");
If the style property has not been set anywhere in the
style lookup chain, the value returned by getStyle()
is undefined
.
Note that undefined
is a special value that is
not the same as false
, ""
,
NaN
, 0
, or null
.
No valid style value is ever undefined
.
You can use the method
IStyleManager2.isValidStyleValue()
to test whether the value was set.
參數
styleProp:String — Name of the style property.
|
* — Style value.
|
insertText | () | 方法 |
public function insertText(text:String):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Inserts the specified text into the text component as if you had typed it.
If a range was selected, the new text replaces the selected text. If there was an insertion point, the new text is inserted there.
An insertion point is then set after the new text. If necessary, the text will scroll to ensure that the insertion point is visible.
參數
text:String — The text to be inserted.
|
擲回值
Error — This method or property cannot be used on a text field with a style sheet.
|
scrollToRange | () | 方法 |
public function scrollToRange(anchorPosition:int, activePosition:int):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Scroll so the specified range is in view.
參數
anchorPosition:int — The anchor position of the selection range.
| |
activePosition:int — The active position of the selection range.
|
selectAll | () | 方法 |
public function selectAll():void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Selects all of the text.
selectRange | () | 方法 |
public function selectRange(anchorIndex:int, activeIndex:int):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Selects a specified range of characters.
If either position is negative, it will deselect the text range.
參數
anchorIndex:int — The character position specifying the end
of the selection that stays fixed when the selection is extended.
| |
activeIndex:int — The character position specifying the end
of the selection that moves when the selection is extended.
|
setFocus | () | 方法 |
public function setFocus():void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Set focus to this text field.
setStyle | () | 方法 |
public function setStyle(styleProp:String, value:*):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Sets a style property on this component instance.
This can override a style that was set globally.
Calling the setStyle()
method can result in decreased performance.
Use it only when necessary.
參數
styleProp:String — Name of the style property.
| |
value:* — New value for the style.
|
styleChanged | () | 方法 |
public function styleChanged(styleProp:String):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Detects changes to style properties. When any style property is set,
Flex calls the styleChanged()
method,
passing to it the name of the style being set.
This is an advanced method that you might override
when creating a subclass of UIComponent. When you create a custom component,
you can override the styleChanged()
method
to check the style name passed to it, and handle the change accordingly.
This lets you override the default behavior of an existing style,
or add your own custom style properties.
If you handle the style property, your override of
the styleChanged()
method should call the
invalidateDisplayList()
method to cause Flex to execute
the component's updateDisplayList()
method at the next screen update.
參數
styleProp:String — The name of the style property, or null if all styles for this
component have changed.
|
truncateToFit | () | 方法 |
public function truncateToFit(truncationIndicator:String = "..."):Boolean
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4.5 |
執行階段版本: | AIR 2.5 |
Truncate text to make it fit horizontally in the area defined for the control, and append an ellipsis, three periods (...), to the text. This function only works for single line text.
參數
truncationIndicator:String (default = "... ") — The text to be appended after truncation.
If you pass null , a localizable string
such as "..." will be used.
|
Boolean — true if the text needed truncation.
|
Tue Jun 12 2018, 03:47 PM Z