Skip to main content
Known Participant
September 25, 2009
Question

Horrible Text Scrolling Performance

  • September 25, 2009
  • 1 reply
  • 1070 views

If I have a spark TextArea with a scrollbar to scroll through the text, and I have 500+ lines of text, it takes about a half a second to update the display list: it's super choppy.

If I have 2000+ lines of text, it almost can't update at all until I'm done scrolling.

I'm using a MacBook, 10.5, and it usually does well on processor intensive animations and such, so I don't know what's up.

Is this a problem with the text layout framework, or the TextArea?  Does TLF support MS Word like text processing, that is, could you theoretically build a well-performing document editor with the TLF, or is it just for putting nice blocks of text here and there?

And along the same lines, can the TLF support tons of text on the screen like html webpages.  That is, could you have a full blog with thousands of lines of text on a single page like most html blogs are today, using the TLF and RichText and all that, and it would be smooth and fast?

Thanks,

Lance

This topic has been closed for replies.

1 reply

viatroposAuthor
Known Participant
September 28, 2009

anything?

September 28, 2009

The reason that you are seeing slow scrolling performance is because the TextFlow is being incrementally composed (line breaks are being calculated and TextLine display objects are being created to display the text lines) while you scroll.  The most expensive part of the process is the actual creation of the TextLine objects.

If you wish, you can call TextFlow.flowComposer.composeToPosition() up front, which will bypass the incremental composition behavior and create all of the text lines immediately.  Doing so can take a few seconds for a longer text flow, which may prevent the player from advancing to the next frame until that work is done.

There are more advanced ways of handling this situation, but a deeper understanding of TLF is required to implement such a solution.

Hope this helps,

Brent

viatroposAuthor
Known Participant
September 28, 2009

Thanks Brent for the response, that makes sense.

Is there a way then to cache the TextLine objects once they are created, like the ViewStack?

And is it possible to create a full on blog with tons and tons of text that performs well?

Thanks!

Lance