Skip to main content
April 7, 2009
Answered

TextFlow onChanged event?

  • April 7, 2009
  • 1 reply
  • 699 views

Is there any sort of event to track when text in a TextFlow has changed?

This topic has been closed for replies.
Correct answer robin_briggs

You could listen for the DamageEvent. That gets sent whenever something happens that causes the text to require a redraw:

textFlow.addEventListener(DamageEvent.DAMAGE, damageHandler);

If you want to find out after the fact if the text or formatting of the TextFlow has changed, you can check its generation number. This is not quite the same thing, as changes to the controller, such as resizing, are not reflected in the TextFlow's generation number.

1 reply

robin_briggsCorrect answer
Adobe Employee
April 7, 2009

You could listen for the DamageEvent. That gets sent whenever something happens that causes the text to require a redraw:

textFlow.addEventListener(DamageEvent.DAMAGE, damageHandler);

If you want to find out after the fact if the text or formatting of the TextFlow has changed, you can check its generation number. This is not quite the same thing, as changes to the controller, such as resizing, are not reflected in the TextFlow's generation number.