Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > TextField | |||
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 default size for a text field is 100 x 100 pixels.
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.
ActionScript provides several ways to format your text at runtime. The TextFormat class lets you set character and paragraph formatting for TextField objects. In Flash Player 7 and later, you can apply Cascading Style Sheets (CSS) styles to text fields using the TextField.styleSheet property and the StyleSheet class. You can use CSS to style built-in HTML tags, define new formatting tags, or apply styles. You can assign HTML formatted text, which might optionally use CSS styles, directly to a text field. In Flash Player 7 and later, HTML text that you assign to a text field can contain embedded media (movie clips, SWF files, JPEG files, GIF files, PNG files). The text wraps around the embedded media in the same way that a web browser wraps text around media embedded in an HTML document.
Flash Player supports a subset of HTML tags that you can use to format text.
Availability: ActionScript 1.0; Flash Player 6
Object, createTextField (MovieClip.createTextField method)
|
Modifiers |
Property |
Description |
|---|---|---|
|
|
Sets or retrieves the alpha transparency value of the text field. |
|
|
|
The type of anti-aliasing used for this TextField instance. |
|
|
|
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 |
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. |
|
|
|
Specifies whether to render using embedded font outlines. |
|
|
|
An indexed array containing each filter object currently associated with the text field. |
|
|
|
The type of grid fitting used for this TextField instance. |
|
|
|
The height of the text field in pixels. |
|
|
|
Deprecated since Flash Player 7. This property was deprecated in favor of 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 |
Indicates the maximum value of |
|
|
Indicates the maximum value of |
|
|
|
Associates the ContextMenu object contextMenu with the text field my_txt. |
|
|
|
A Boolean value that indicates whether Flash Player should automatically scroll multiline text fields when the mouse pointer clicks a text field and the user rolls the mouse wheel. |
|
|
|
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. |
|
|
|
The rendering quality used for a SWF file. |
|
|
|
Indicates the set of characters that a user may enter into the text field. |
|
|
|
The rotation of the text field, in degrees, from its original orientation. |
|
|
|
The vertical position of text in a text field. |
|
|
|
A Boolean value that indicates whether the text field is selectable. |
|
|
|
The sharpness of the glyph edges in this TextField instance. |
|
|
|
The number of seconds a sound prebuffers before it starts to stream. |
|
|
|
Attaches a style sheet to the text field. |
|
|
|
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, in pixels. |
|
|
|
Indicates the width of the text, in pixels. |
|
|
|
The thickness of the glyph edges in this TextField instance. |
|
|
|
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 |
Invoked when a text field loses keyboard focus. |
|
onScroller |
Event handler/listener; invoked when one of the text field scroll properties changes. |
|
onSetFocus |
Invoked when a text field receives keyboard focus. |
|
Modifiers |
Signature |
Description |
|---|---|---|
|
|
addListener |
Registers an object to receive TextField event notifications. |
|
|
Returns the depth of a text field. |
|
|
|
getFontList |
Returns the names of fonts on the player's host system as an array. |
|
|
Returns a TextFormat object containing a copy of the text field's text format object. |
|
|
|
getTextFormat |
Returns a TextFormat object for a character, a range of characters, or an entire TextField object. |
|
|
removeListener |
Removes a listener object previously registered to a text field instance with |
|
|
removeTextField |
Removes the text field. |
|
|
replaceSel |
Replaces the current selection with the contents of the |
|
|
replaceText |
Replaces a range of characters, specified by the |
|
|
setNewTextFormat |
Sets the default new text format of a text field. |
|
|
setTextFormat |
Applies the text formatting specified by the |
Methods inherited from class Object
Flash CS3
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00002190.html
Comments
Supashy said on Apr 30, 2008 at 2:56 AM :