Object | +-TextField public dynamic class TextField extends Object
The TextField class is used to create areas for text display and input. All dynamic and input text fields in a SWF file are instances of the TextField class. You can give a text field an instance name in the Property inspector and use the methods and properties of the TextField class to manipulate it with ActionScript. TextField instance names are displayed in the Movie Explorer and in the Insert Target Path dialog box in the Actions panel.
To create a text field dynamically, you do not use the new operator. Instead, you use MovieClip.createTextField().
The methods of the TextField class let you set, select, and manipulate text in a dynamic or input text field that you create during authoring or at runtime.
Object, createTextField (MovieClip.createTextField method)
|
Modifiers |
Property |
Description |
|---|---|---|
|
Sets or retrieves the alpha transparency value of the text field. |
||
|
|
Controls automatic sizing and alignment of text fields. |
|
|
|
Specifies if the text field has a background fill. |
|
|
|
The color of the text field background. |
|
|
|
Specifies if the text field has a border. |
|
|
|
The color of the text field border. |
|
|
|
bottomScroll:Number [read-only] |
An integer (one-based index) that indicates the bottommost line that is currently visible the text field. |
|
|
A Boolean value that specifies whether extra white space (spaces, line breaks, and so on) in an HTML text field should be removed when the field is rendered in a browser. |
|
|
|
A Boolean value that specifies whether to render the text using embedded font outlines. |
|
|
|
The height of the text field in pixels. |
|
|
|
Deprecated since Flash Player 7. This property was deprecated in favor of TextField._quality. Specifies the level of anti-aliasing applied to the current SWF file. |
|
|
|
Indicates the current horizontal scrolling position. |
|
|
|
A flag that indicates whether the text field contains an HTML representation. |
|
|
|
If the text field is an HTML text field, this property contains the HTML representation of the text field's contents. |
|
|
|
Indicates the number of characters in a text field. |
|
|
|
Indicates the maximum number of characters that the text field can contain. |
|
|
|
maxhscroll:Number [read-only] |
Indicates the maximum value of TextField.hscroll. |
|
|
Indicates the maximum value of TextField.scroll. |
|
|
|
Indicates whether the text field is a multiline text field. |
|
|
|
The instance name of the text field. |
|
|
|
A reference to the movie clip or object that contains the current text field or object. |
|
|
|
Specifies whether the text field is a password text field. |
|
|
|
Property (global); sets or retrieves the rendering quality used for a SWF file. |
|
|
|
The rotation of the text field, in degrees, from its original orientation. |
|
|
|
Defines the vertical position of text in a text field. |
|
|
|
A Boolean value that indicates whether the text field is selectable. |
|
|
|
Specifies the number of seconds a sound prebuffers before it starts to stream. |
|
|
|
Specifies whether the text field is included in automatic tab ordering. |
|
|
|
Lets you customize the tab ordering of objects in a SWF file. |
|
|
|
The target path of the text field instance. |
|
|
|
Indicates the current text in the text field. |
|
|
|
Indicates the color of the text in a text field. |
|
|
|
Indicates the height of the text. |
|
|
|
Indicates the width of the text. |
|
|
|
Specifies the type of text field. |
|
|
|
Retrieves the URL of the SWF file that created the text field. |
|
|
|
The name of the variable that the text field is associated with. |
|
|
|
A Boolean value that indicates whether the text field my_txt is visible. |
|
|
|
The width of the text field, in pixels. |
|
|
|
A Boolean value that indicates if the text field has word wrap. |
|
|
|
An integer that sets the x coordinate of a text field relative to the local coordinates of the parent movie clip. |
|
|
|
Returns the x coordinate of the mouse position relative to the text field. |
|
|
|
Determines the horizontal scale of the text field as applied from the registration point of the text field, expressed as a percentage. |
|
|
|
The y coordinate of a text field relative to the local coordinates of the parent movie clip. |
|
|
|
Indicates the y coordinate of the mouse position relative to the text field. |
|
|
|
The vertical scale of the text field as applied from the registration point of the text field, expressed as a percentage. |
Properties inherited from class Object
|
constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property) |
|
Event |
Description |
|---|---|
|
Event handler/listener; invoked when the content of a text field changes. |
|
|
onKillFocus = function(newFocus:Object) {} |
Invoked when a text field loses keyboard focus. |
|
onScroller = function(scrolledField:TextField) {} |
Event handler/listener; invoked when one of the text field scroll properties changes. |
|
onSetFocus = function(oldFocus:Object) {} |
Invoked when a text field receives keyboard focus. |
|
Modifiers |
Signature |
Description |
|---|---|---|
|
|
addListener(listener:Object) : Boolean |
Registers an object to receive TextField event notifications. |
|
|
Returns the depth of a text field. |
|
|
|
Returns a TextFormat object containing a copy of the text field's text format object. |
|
|
|
getTextFormat([beginIndex:Number], [endIndex:Number]) : TextFormat |
Returns a TextFormat object for a character, for a range of characters, or for an entire TextField object. |
|
|
removeListener(listener:Object) : Boolean |
Removes a listener object previously registered to a text field instance with TextField.addListener(). |
|
|
removeTextField() : Void |
Removes the text field. |
|
|
replaceSel(newText:String) : Void |
Replaces the current selection with the contents of the newText parameter. |
|
|
replaceText(beginIndex:Number, endIndex:Number, newText:String) : Void |
Replaces a range of characters, specified by the beginIndex and endIndex parameters, in the specified text field with the contents of the newText parameter. |
|
|
setNewTextFormat(tf:TextFormat) : Void |
Sets the default new text format of a text field. |
|
|
setTextFormat([beginIndex:Number], [endIndex:Number], textFormat:TextFormat) : Void |
Applies the text formatting specified by the textFormat parameter to some or all of the text in a text field. |
Methods inherited from class Object