Search code examples
apache-flexactionscript-3textareaflex4tlf

Events dispatched by setFormatofRange


I have a text area on which I would like to listen to change events when I change the text formatting using setFormatOfRange(). So far all other events I have tried, such as Event.CHANGE or TextOperationEvent.CHANGE are only dispatched when the actual text is changed.

Anyone know what I should be listening for ?


Solution

  • Actually you can get TextOperationEvent.CHANGE when formatting is change, but only if you use EditManager. You should create an EditManager object and assigns to TextArea.textFlow.interactionManager and all your format operation should be performed through this EditManager object. It has methods like applyFormat.

    And I do not recommend using setFormatOfRange because it's pretty slow for large number of format operation. Instead you should use EditManager or ApplyFormatOperation objects. here's a post in which is explained how to use ApplyFormatOperation objects