Description
Method; retrieves the attribute specified by the
parameter for the text identified by
attrName
the optional
and
parameters. If the attribute is not consistent for the
startIndex
endIndex
specified range, Flash returns
. If you omit the optional parameters
undefined
startIndex
and
, the method uses the entire text range. If you specify only
, the
endIndex
startIndex
range used is a single character at that position. If you specify both
and
startIndex
, the range starts from
and goes up to, but does not include,
.
endIndex
startIndex
endIndex
Example
The following example gets the font size of the currently selected text field and shows it:
var TheTextSize = fl.getDocumentDOM().selection[0].getTextAttr("size");
fl.trace(TheTextSize);
The following example gets the text fill color of the selected text field:
var TheFill = fl.getDocumentDOM().selection[0].getTextAttr("fillColor");
fl.trace(TheFill);
The following example gets the size of the third character:
var Char2 = fl.getDocumentDOM().selection[0].getTextAttr("size", 2);
fl.trace(Char2);
The following example gets the color of the selected text field from the third through the
eighth character:
fl.getDocumentDOM().selection[0].getTextAttr("fillColor", 2, 8);
text.getTextString()
Availability
Flash MX 2004.
Usage
text.getTextString([startIndex [, endIndex] ])
Parameters
An integer that specifies the index (zero-based) of the first character. This
startIndex
parameter is optional.
An integer that specifies the end of the range of text, which starts from
endIndex
and goes up to, but does not include,
. This parameter is optional.
startIndex
endIndex
Returns
A string of the text in the specified range.
444
Objects
Need help?
Do you have a question about the FLASH 8-EXTENDING FLASH and is the answer not in the manual?