FlashTextEditor.selectionChange

Availability

Flash Player 8
Flash Player 9(AS3 version)

Usage

listenerObject = new Object();
listenerObject.selectionChange = function( eventObject ){
	// insert your code here 
}
myTextEditor.addEventListener( "selectionChange", listenerObject )

Description

Event; Broadcast to all registered listeners when format of selected text is changed.
Event object properties:

target - component instance
format - Object. TextFormat values of currently selected text.
styleName - String. Name of the selection style.
pstyleName - String. Name of the selection paragraph style.
style - Object. Style object of the selection.
pstyle - Object. Paragraph style object of the selection.
disabled - Object. Properties that should be disabled

Example

The following code will output name of the style for the currently selected text:

textListener = new Object(); 
textListener.selectionChange = function( eo:Object ){ 
	trace( eo.styleName );
} 
myTextEditor.addEventListener("selectionChange", textListener);