beautypg.com

Document.getfilters() – Adobe Extending Flash Professional CS5 User Manual

Page 129

background image

107

EXTENDING FLASH PROFESSIONAL

Document object

Last updated 5/2/2011

Returns
If one text field is selected, the property is returned if there is only one value used within the text. Returns

undefined

if there are several values used inside the text field. If several text fields are selected, and all the text alignment values
are equal, the method returns this value. If several text fields are selected, but all the text alignment values are not equal,
the method returns

undefined

. If the optional arguments are not passed, these rules apply to the range of text

currently selected or the whole text field if the text is not currently being edited. If only startIndex is passed, the
property of the character to the right of the index is returned, if all the selected Text objects match values. If startIndex
and endIndex are passed, the value returned reflects the entire range of characters from startIndex up to, but not
including, endIndex.

Description
Method; gets a specific

TextAttrs

property of the selected Text objects. Selected objects that are not text fields are

ignored. For a list of property names and expected values, see the Property summary table for the

TextAttrs object

. See

also

document.setElementTextAttr()

.

Example
The following example gets the size of the selected text fields:

fl.getDocumentDOM().getElementTextAttr("size");

The following example gets the color of the character at index 3 in the selected text fields:

fl.getDocumentDOM().getElementTextAttr("fillColor", 3);

The following example gets the font name of the text from index 2 up to, but not including, index 10 of the selected
text fields:

fl.getDocumentDOM().getElementTextAttr("face", 2, 10);

document.getFilters()

Availability
Flash 8.

Usage

document.getFilters()

Parameters
None.

Returns
An array that contains a list of filters applied to the currently selected object(s).

Description
Method; returns an array that contains the list of filters applied to the currently selected object(s). If multiple objects
are selected and they don’t have identical filters, this method returns the list of filters applied to the first selected object.

Example
See

document.setFilters()

.

This manual is related to the following products: