• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Part: VII Appendixes > The TextField and TextFormat Classes

The TextField and TextFormat Classes

Table A.12. TextField Attributes, Methods, and Events
NameMethod/Attribute/Event/FormatDescription
addListenerMmyTextField.addListener (myObject)Registers myObject to receive notification of onChanged and onScroller events associated with myTextField.
getDepthMmyTextField.getDepth()Returns the depth of myTextField.
getFontListMTextField.getFontList()Returns an array of font names. Note: TextField, not myTextField.
getNewTextFormatMmyTextField.getNewTextFormat()Returns a copy of the TextFormat object applied to new text inserted in myTextField manually or using replaceSel().
removeListenerMmyTextField.removeListener(myObject)Removes myObject from the array of listeners associated with myTextField, that is, cancels myTextField.addListener(myObject).
removeTextFieldMmyTextField.removeTextField()Removes myTextField, if it was created with MovieClip.create TextField().
setNewTextFormatMmyTextField.setNewTextFormat (myTextFormat)Sets myTextFormat as the text format object for new text inserted in myTextField manually or using replaceSel().
replaceSelMmyTextField.replaceSel(newText)Substitutes the newText string for currently selected text.
setTextFormatMmyTextField.setTextFormat (myTextFormat)Assigns myTextFormat to text that is already in myTextField.
_alphaAmyTextField._alphaThe transparency value of myTextField, an integer from 0 to 100.
autoSizeAmyTextField.autoSizeA string specifying the anchor point for myTextField when it is being automatically resized to fit text. See Table A.13.
backgroundAmyTextField.backgroundA Boolean that shows (true) or hides (false) background fill.
backgroundColorAmyTextField.backgroundColorSpecifies the color of the background fill. An integer, often in hexadecimal format, for example, 0xFF0000.
borderAmyTextField.borderA Boolean that specifies whether the text field has a border.
borderColorAmyTextField.borderColorSpecifies the color of the border. An integer, often in hexa decimal format, for example, 0xFF0000.
bottomScrollAmyTextField.bottomScrollA read-only integer specifying the bottommost line in myTextField that is visible.
condenseWhiteAmyTextField. condenseWhiteA Boolean that specifies whether “white space” (including spaces, line breaks, and paragraph breaks) are removed from HTML text. Ignored if html attribute is false.
embedFontsAmyTextField.embedFontsA Boolean that specifies whether the text field uses embedded font outlines (true) or device fonts (false).
_focusrectAmyTextField._focusrectA Boolean that specifies whether a text field has a yellow rectangle around it when it has focus.
_highqualityATextField._highqualityReferences the global _highquality variable. Globally enables smoothing bitmaps and antialiasing. An integer. 0 : none. 1 : antialias, smooth bitmaps if no animation in movie (default). 2 : smooth bitmaps and antialias.
_heightAmyTextField._heightA read-write integer, the height of myTextField in pixels. Affects bounding box size only, not font size.
hscrollAmyTextField.hscrollAn integer that specifies, in pixels, the current horizontal scroll position of myTextField.
htmlAmyTextField.htmlA Boolean that specifies whether myTextField contains HTML text. Must precede myTextField.htmlText.
htmlTextAmyTextField.htmlTextA string containing HTML-formatted text for myTextField.
lengthAmyTextField.lengthA read-only integer, the number of characters in myTextField.
maxCharsAmyTextField.maxCharsAn integer. When myTextField contains this number of characters, Flash disables manual insertion of characters.
maxhscrollAmyTextField.maxhscrollA read-only integer value that specifies, in pixels, the maximum possible value of myTextField.hscroll, given the current text.
maxscrollAmyTextField.maxscrollA read-only integer value that specifies, in pixels, the maximum possible value of myTextField.scroll, given the current text.
multilineAmyTextField.multilineA Boolean that specifies whether myTextField can contain multiple lines.
_nameAmyTextField._nameA string, the instance name, for example, "myTextField".
_parentAmyTextField._parentA reference to the movie clip or button that is myTextField's parent.
passwordAmyTextField.passwordA Boolean that specifies whether myTextField is a password field. If it is true, Flash displays asterisks on the screen instead of input characters.
_qualityATextField._qualityGlobal string attribute, specifies the rendering quality of a movie. LOW: Graphics not antialiased; bitmaps not smoothed. MEDIUM: Graphics antialiased using a 2 × 2 pixel grid; bitmaps not smoothed. Suitable for movies with no text. HIGH: Graphics antialiased using a 4 × 4 pixel grid; bitmaps smoothed if no animation in movie. (HIGH is the default.) BEST: Graphics antialiased using a 4 × 4 pixel grid; bitmaps always smoothed.
restrictAmyTextField.restrictA string specifying the set of characters that a user can enter into myTextField. A dash indicates a range. A caret (^) means the following characters are excluded, whereas preceding characters are allowed. The following example includes only lowercase letters, but excludes the lowercase letter w: myTextField.restrict = "a-z^w";
_rotationAmyTextField._rotationA read-write integer value that specifies the current degree of rotation of myTextField.
scrollAmyTextField.scrollA read-write integer value that specifies the current vertical scrolling position of myTextField, measured in lines of text.
selectableAmyTextField.selectableBoolean, specifies whether myTextField is selectable.
_soundbuftimeAmyTextField._soundbuftimeReferences the global _sound buftime variable. Globally sets and gets the amount of time, in seconds, a sound must prebuffer before it streams. An integer, defaulting to 5.
tabEnabledAmyTextField.tabEnabledA Boolean that specifies myTextField is included in automatic tab ordering.
tabIndexAmyTextField.tabIndexSpecifies the tab order of myTextField.
textAmyTextField.textA read-write string, the current text in the text field.
textColorAmyTextField.textColorA read-write integer, the color of the current text in the text field. Often in hex format, such as 0xFF0000.
textHeightAmyTextField.textHeightA read-only integer value that specifies the height of the actual text (not the bounding box).
textWidthAmyTextField.textWidthA read-only integer value that specifies the width of the actual text (not the bounding box).
typeAmyTextField.typeA read-write string, dynamic or input, that specifies whether myTextField is an input text field or dynamic text field.
_urlAmyTextField._urlA read-only string, the URL of the SWF file that created the text field instance.
variableAmyTextField.variableA read-write string, the variable name associated with the text field.
_visibleAmyTextField._visibleA read-write Boolean value that determines whether myTextField is hidden (false) or visible (true).
_widthAmyTextField._widthA read-write integer, the width of myTextField in pixels. This affects only the bounding box of the text field; it does not affect the border thickness or text font size.
wordWrapAmyTextField.wordWrapA read-write Boolean that specifies whether the text field word-wraps.
_xAmyTextField._xA read-write integer, the x coordinate of myTextField.
_xmouseAmyTextField._xmouseA read-only integer, the x coordinate of the cursor relative to myTextField.
_xscaleAmyTextField._xscaleA read-write integer from -100 to 100, specifying the percentage for horizontally scaling myTextField.
_yAmyTextField._yA read-write integer, the y coordinate of myTextField.
_ymouseAmyTextField._ymouseA read-only integer, the y coordinate of the cursor relative to myTextField.
_yscaleAmyTextField._yscaleA read-write integer from -100 to 100, specifying the percentage for vertically scaling myTextField.
onChangedEmyTextField.onChanged = function (textfieldName) {}Invoked when the text in the field is changed.
onKillFocusEmyTextField.onKillFocus = function (newFocus) {}Invoked when the text field loses focus.
onScrollerEmyTextField.onScroller = function (textfieldName) {}Invoked when the scroll,maxscroll, hscroll, maxhscroll, or bottomscroll attribute of myTextField changes.
onSetFocusEmyTextField.onSetFocus = function (oldFocus) {}Invoked when the text field receives focus.


Table A.13. TextField.autoResize Values
ValueSingle LineMultiline
"none" or falseDo not automatically resizeDo not automatically resize
"left" or trueExpand rightExpand bottom
"center"Expand right and leftExpand bottom
"right"Expand leftExpand bottom



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint