This class is used for non-editable text fields (as opposed to
<inputtext>). A text field can be initalized
with text content at compile time.
Text objects can also display text that is computed at
runtime.
Note that certain attributes on text objects, such as opacity and rotation, only work on
embedded fonts. They do not work on client fonts (also called platform fonts, native fonts,
platform fonts, etc). See the Developer's Guide for details.
See Also:
- The Text Views chapter of the Developer's Guide
for a discussion of how to include and manipulate text
- The
canvas.maxtextheight and canvas.maxtextwidth attributes
Attributes inherited from <view>
aaactive, aadescription, aaname, aasilent, aatabindex, align, bgcolor, cachebitmap, clickable, clickregion, clip, contextmenu, cursor, fgcolor, focusable, focustrap, font, fontsize, fontstyle, frame, framesloadratio, hassetheight, hassetwidth, height, layout, loadratio, mask, opacity, pixellock, playing, proxyurl, resource, resourceheight, resourcewidth, rotation, showhandcursor, source, stretches, subviews, totalframes, unstretchedheight, unstretchedwidth, valign, visibility, visible, width, x, xoffset, y, yoffset
Attributes inherited from <node>
classroot, cloneManager, datapath, defaultplacement, id, ignoreplacement, immediateparent, inited, initstage, name, nodeLevel, options, parent, placement, subnodes
Methods
-
-
text.addFormat(control : string, args : [*]);
Appending version of formatted output.
Formats its arguments using
LzFormatter.formatToString() and adds the
result to the text of the view.
-
-
text.addText(t : String);
Appends the string to the current text in the textfield.
-
-
Clears the text field (by setting its text to the empty string)
-
-
text.escapeText(ts : String);
Returns an escaped version of the string if called with no args. If called
with a string argument, returns an escaped version of that string (escaped
here means markup-escaped, not http escaped.)
-
-
text.format(control : string, args : [*]);
-
-
Gets the kind of antialiasing set on this text object
-
-
Gets the kind of grid fitting set on this text object
-
-
text.getSelectionPosition();
Returns the position of the text cursor within this object. If the text
cursor is not inside this object, then the method returns -1.
-
-
Returns the length of the text selection in within this object. If the text
cursor is not inside this object, then the method returns -1.
-
-
Gets the sharpness rendering property of this text object
-
-
Returns the string represented in the text field
-
-
Calculates the current height of the text held by the text field.
-
-
Calculates the current width of the text held by the text field.
-
-
Gets the thickness rendering property of this text object
-
-
text.makeTextLink(str : String, value : String);
Return a string which can be used to insert a hyperlink in a text field.
-
-
text.setAntiAliasType(aliasType : String);
![[Caution]](images/caution.png) |
This method is deprecated |
| Use setAttribute('antiAliasType', ...) instead. |
Sets what type of antialiasing the text field should use. Only works in swf8
and higher.
-
-
text.setGridFit(gridFit : String);
![[Caution]](images/caution.png) |
This method is deprecated |
| Use setAttribute('gridFit', ...) instead. |
Sets what type of grid fitting the text field should use.
Only works in swf8 and higher.
-
-
text.setHScroll(s : Number);
Sets the horizontal scroll position
-
-
text.setMultiline(ml : Boolean);
![[Caution]](images/caution.png) |
This method is deprecated |
| Use setAttribute('multiline', ...) instead. |
Sets whether or not the textfield wraps. If false, only a single line
of text will appear and extra lines will be trucated if the text is set with
multiple lines.
-
-
text.setResize(val : Boolean);
![[Caution]](images/caution.png) |
This method is deprecated |
| Use setAttribute('resize', ...) instead. |
setResize set behavior of text field width when new text is added.
LzText only (cannot be used with LzInputText).
-
-
text.setScroll(h : Number);
Sets the vertical scroll position
-
-
text.setSelectable(isSel : Boolean);
![[Caution]](images/caution.png) |
This method is deprecated |
| Use setAttribute('selectable', ...) instead. |
Sets the selectability (with Ibeam cursor) of the text field
-
-
text.setSelection(start : Number, end : Number);
Positions the text selection within the text field. If this object does
not already have the focus, this has the ancillary effect of giving it the
focus.
-
-
text.setSharpness(sharpness : Number);
![[Caution]](images/caution.png) |
This method is deprecated |
| Use setAttribute('sharpness', ...) instead. |
Sets the sharpness for the text rendering
Only works in swf8 and higher.
-
-
text.setText(t : String);
![[Caution]](images/caution.png) |
This method is deprecated |
| Use setAttribute('text', ...) instead. |
Sets the text of the field to display
-
-
text.setThickness(thickness : Number);
![[Caution]](images/caution.png) |
This method is deprecated |
| Use setAttribute('thickness', ...) instead. |
Sets the thickness for the text rendering
Only works in swf8 and higher.
-
-
text.setXScroll(n : Number);
![[Caution]](images/caution.png) |
This method is deprecated |
| Use setAttribute('xscroll', ...) instead. |
Set the x scroll position of the textfield.
-
-
text.setYScroll(n : Number);
![[Caution]](images/caution.png) |
This method is deprecated |
| Use setAttribute('yscroll', ...) instead. |
Set the y scroll position of the textfield.
Methods inherited from <view>
bringToFront, containsPt, getAttributeRelative, getBounds, getColor, getColorTransform, getContextMenu, getCurrentTime, getDepthList, getID3, getMouse, getNextSelection, getPan, getPrevSelection, getProxyURL, getTotalTime, getVolume, init, measureHeight, measureWidth, play, proxyurl, releaseLayouts, searchSubviews, seek, sendAAEvent, sendBehind, sendInFrontOf, sendToBack, setAAActive, setAADescription, setAAName, setAASilent, setAATabIndex, setAccessible, setAlign, setAttributeRelative, setBGColor, setClickable, setColor, setColorTransform, setContextMenu, setCursor, setHeight, setLayout, setOpacity, setPan, setPlay, setProxyPolicy, setProxyURL, setResource, setResourceNumber, setRotation, setShowHandCursor, setSource, setValign, setVisibility, setVisible, setVolume, setWidth, setX, setXOffset, setY, setYOffset, shouldYieldFocus, stop, stretchResource, unload, updateResourceSize
Methods inherited from <node>
animate, applyConstraint, applyConstraintMethod, applyData, childOf, completeInstantiation, construct, createChildren, dataBindAttribute, destroy, determinePlacement, getAttribute, getOption, getUID, init, lookupSourceLocator, releaseConstraint, releaseConstraintMethod, searchImmediateSubnodes, searchSubnodes, setData, setDatapath, setOption, setSelected, updateData
Events inherited from <view>
onaddsubview, onblur, onclick, ondblclick, onerror, onfocus, onframe, onframesloadratio, onheight, onkeydown, onkeyup, onlastframe, onload, onloadratio, onmousedown, onmousedragin, onmousedragout, onmouseout, onmouseover, onmouseup, onmouseupoutside, onopacity, onplay, onremovesubview, onstop, ontimeout, onvisible, onwidth, onx, ony