User Guide

124 Chapter 3: Objects
Parameters
boundingRectangle
A text rectangle object that specifies the new size within which the text
item should flow.
Returns
A Boolean value: true if the size of at least one text field is changed; false otherwise.
Description
Method; changes the bounding rectangle for the selected text item to the specified size. This
method causes the text to reflow inside the new rectangle; the text item is not scaled or
transformed. If the text is horizontal and static, the method takes into account only the width of
the rectangle (the height is automatically computed to fit all the text). If the text is vertical, the
method takes into account only the height of the rectangle (the width is automatically computed
to fit all the text). If the text is dynamic or input, the method is limited by the width and height
of the rectangle, but the text field is constrained to fit all the text.
Example
The following example changes the size of the bounding text rectangle to the specified
dimensions:
fl.getDocumentDOM().setTextRectangle({left:0, top:0, right:50, bottom:200})
document.setTextSelection()
Availability
Flash MX 2004.
Usage
document.setTextSelection( startIndex, endIndex )
Parameters
startIndex
An integer that specifies the position of the first character to select. The first
character position is 0 (zero).
endIndex An integer that specifies the end position of the selection up to, but not including,
endIndex. The first character position is 0 (zero).
Returns
A Boolean value: true if the method can successfully set the text selection; false otherwise.
Description
Method; sets the text selection of the currently selected text field to the values specified by the
startIndex and endIndex values. Text editing is activated, if it isnt already.
Example
The following example selects the text from the 6th character through the 25th character:
fl.document.setTextSelection(5, 25);