MACROMEDIA FLASH 8-EXTENDING FLASH Manual page 451

Extending flash
Table of Contents

Advertisement

text.setTextString()
Availability
Flash MX 2004.
Usage
text.setTextString(text [, startIndex [, endIndex]])
Parameters
A string that consists of the characters to be inserted into this text object.
text
An integer that specifies the index (zero-based) of the character in the string
startIndex
where the text will be inserted. This parameter is optional.
An integer that specifies the index of the end point in the selected text string. The
endIndex
new text overwrites the text from
parameter is optional.
Returns
Nothing.
Description
Property; changes the text string within this text object. If you omit the optional parameters,
the whole text object is replaced. If you specify only
inserted at the
startIndex
specified string replaces the segment of text starting from
including,
endIndex
Example
The following example assigns the string
fl.getDocumentDOM().selection[0].setTextString("this is a string");
The following example inserts the string
text field:
fl.getDocumentDOM().selection[0].setTextString("01234567890");
fl.getDocumentDOM().selection[0].setTextString("abc", 4);
// text field is now "0123abc4567890"
The following example replaces the text from the third through the eighth character of the
selected text string with the string
are overwritten. Characters beginning with
endIndex
fl.getDocumentDOM().selection[0].setTextString("01234567890");
fl.getDocumentDOM().selection[0].setTextString("abcdefghij", 2, 8);
// text field is now 01abcdefghij890"
startIndex
position. If you specify both
.
"this is a string"
"abc"
"abcdefghij"
up to, but not including,
, the specified string is
startIndex
startIndex
startIndex
to the selected text field:
beginning at the fifth character of the selected
. Characters between
follow the inserted string.
endIndex
. This
endIndex
and
, the
endIndex
up to, but not
and
startIndex
Text object
451

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-EXTENDING FLASH and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash 8

Table of Contents