i ran into serious problems when I wanted to load a 41KB file of "text layout formatted" into a textflow... Flash player is freezing for about 30 seconds (but finally loads the text correctly). This file is basically a bunch of ParagraphElement (<p>) which can contain around 2000 chars for the longest, each paragraph containing spans and anchors (no more than 20 spans & "a" tags by paragraph).
My problem could be related to this one, but is not the same:
Actually I use a RichEditableText, so the solution found by
If it is a big enough textflow, it is probably just taking too long. There
are some performance improvements in 4.1 and more to come in Hero."
Is there no solution to either improve speed of importation (it's the parsing of XML / building of the object tree that are taking so long ?) or slicing the process of parsing so that the UI doesn't freeze ??? Is there no possibility of doing incremental parsing with the textLayout API ?? Can I "serialize" the TextFlow in order to load it faster ? Or am I looking at the wrong direction and what is taking so long is the rendering of the text ??
If I have to implement something to handle this, I have to know a bit more about the underlying implementation of TextConverter.importToFlow...
Otherwise I will have to rasterize the text and load an image, which is a really bad solution...
Anybody found a way to handle this kind of issue ?
I realize that I was misleading completly...
My problem was not related at all to the textLayout implementation... but to the LayoutManager...
The RichEditableText is a child of some container, and I'm toggling its visibility and resizing it when I need to show some text. It seems that the cause of the freezing was that the RichEditableText had a 0 width when the textflow was loaded.
I tried to call validateNow() on the container and the RichEditableText before the loading of the text, and the measurement seemed to be ok, but the freezing still occured.
So I modified the MXML in order to force the component to have the right size at initialization phase, and toggled visibility and resized it programmatically after initialization with a creationComplete handler, because I need the component to be hidden by default.
And now it works !
What a mess...