The FlashTextEditor2 component does not have a visual appearence when it is exported to a swf file but it provides you with a programming interface for controlling the rich text format of the targeted text field.

FlashTextEditor2 component panel parameters

Parameter

Description

cssFile The location of the CSS file.

linkColor

The color of the linked text (if it is not defined inside a CSS file).

targetBorderColor

The border color of the currently targeted text field.

targetTextField The name of the targeted text field.

undoLevels

The number of undo levels. A value of 0 will disable the undo functionality.

FlashTextEditor2 Properties

Property

Description

enabled

Indicates whether the component is active or not.

linkColor

The color of the linked text (if it is not defined inside a CSS file)

targetBorderColor

The border color of the currently targeted text field.

targetTextField*

Sets the currently edited text field.

style

The styleSheet object of the text field.

cssFile

The location of the CSS file.

undoLevels

The number of undo levels. A value of 0 will disable undo.

toggleView

A Boolean value indicating whether the component is in HTML view (true) or not (false).

iniFormat

The initial text format of the targeted text field.

refocus

A Boolean value indicating whether the component should return focus after formatting is applied (true) or not (false).

target** Target TextField or Flex TextArea.

FlashTextEditor2 Methods

Method

Description

getHTML Returns an html string of the content of the currently edited text field.

setHTML

Sets the html text of the currently edited text field

toggleHTML

Toggles between normal and code view of the currently edited text field.

setStyle

Changes the style of the currently selected text.

removeStyle

Removes style.

setFormat

Changes the format of the currently selected text.

insertImage

Inserts an image at the position of cursor.

removeImage

Removes an image.

removeLink

Removes the link.

getImages

Returns properties of the images used in the currently edited text field.

getLinks

Returns properties of the links used in the currently edited text field.

undo

Executes an 'undo' action.

redo

Executes a 'redo' action.

doLater*

Calls a function after a user-defined number of frames.

returnFocus

Return focus to the targeted text field.

insert

Inserts characters at the position of cursor.

FlashTextEditor2 Events

Event

Description

change Broadcast to all registered listeners when the html of the targeted text field is changed.

link

Broadcast to all registered listeners when a link inside the targeted text field is clicked.

styleInit

Broadcast to all registered listeners when a StyleSheet for the targeted text field is initialized.

selectionChange

Broadcast to all registered listeners when the format of the selected text is changed.

 

* - available only in ActionScript2 (FlashPlayer 8) version of FTE2
** - available only in ActionScript3 (Flash Player 9) version of FTE2