|
|
|||
Flash Player 8
Flash Player 9(AS3 version)
listenerObject = new Object();
listenerObject.selectionChange = function( eventObject ){
// insert your code here
}
myTextEditor.addEventListener( "selectionChange", listenerObject )
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
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);
|
|
|
|