Skip to main content
Apr 7, 2009 6:25 PM UTC
Answered

TextFlow onChanged event?

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

This topic is closed to new replies. Start a new post to keep the conversation going.
robin_briggsCorrect answer
Adobe Employee
Apr 7, 2009 11:15 PM UTC

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
Apr 7, 2009 11:15 PM UTC

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.

Translate