Text.selectionstart; Text.settextattr() - MACROMEDIA FLASH MX 2004-FLASH JAVASCRIPT DICTIONARY Manual

Flash javascript dictionary
Hide thumbs Also See for FLASH MX 2004-FLASH JAVASCRIPT DICTIONARY:
Table of Contents

Advertisement

text.selectionStart

Availability
Flash MX 2004.
Usage
text.selectionStart
Description
Property; a zero-based integer that specifies the beginning of a text subselection. You can use this
property with
text.selectionEnd
including,
text.selectionEnd
If there is an insertion point or no selection,
text.selectionStart
If
text.selectionStart
text.selectionEnd
Example
The following example sets the start of the text subselection to the sixth character:
fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].selectionSta
rt = 5;
The following example selects the characters "Barbara" from a text field that contains the text "My
name is Barbara" and formats them as bold and green:
fl.getDocumentDOM().selection[0].selectionStart = 11;
fl.getDocumentDOM().selection[0].selectionEnd = 18;
var s = fl.getDocumentDOM().selection[0].selectionStart;
var e = fl.getDocumentDOM().selection[0].selectionEnd;
fl.getDocumentDOM().setElementTextAttr('bold', true, s, e);
fl.getDocumentDOM().setElementTextAttr("fillColor", "#00ff00", s, e);

text.setTextAttr()

Availability
Flash MX 2004.
Usage
text.setTextAttr(attrName, attrValue [, startIndex [, endIndex]])
Parameters
A string that specifies the name of the TextAttrs object property to change.
attrName
The value for the TextAttrs object property.
attrValue
Note: For a list of possible values for
TextAttrs object" on page
An integer that is the index (zero-based) of the first character in the array. This
startIndex
parameter is optional.
316
Chapter 3: Objects
to select a range of characters. Characters up to, but not
are selected.
.
is set to a value greater than
is set to
text.selectionStart
and
attrName
299.
text.selectionEnd
text.selectionEnd
, and no text is selected.
, see
"Property summary for the
attrValue
is equal to
,

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-FLASH JAVASCRIPT DICTIONARY and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents