Skip to main content
Participant
June 25, 2009
Answered

Append "markup" text to existing textFlow

  • June 25, 2009
  • 2 replies
  • 991 views

Hello,

what is the best way to append text with inline graphic to the end of existing textFlow component ? Imagine chat flash client - server sends a new string of XML markup text and client needs to append it to the bottom of "chat history" textFlow.

i read that one of the possible methods is to export to XML then append new markup text and then import to textFlow - but isnt it too slow, considering that textFlow will have alot of data ?

Thank you in advance!

This topic has been closed for replies.
Correct answer Abhi.G.

You are better off importing the new markup and appending the children of the imported TextFlow to the existing TextFlow.

Abhishek

(Adobe Systems Inc.)

2 replies

June 28, 2009

Hello Spoh,

The TLF have a serious problems with performance, but you can try:

var copiedTextFlow: TextFlow = TextFilter.importToFlow("MARKUP SENT BY SERVER", TextFilter.TEXT_LAYOUT_FORMAT);

while (copiedTextFlow.numChildren)
{
     TextFlow.addChild(copiedTextFlow.getChildAtIndex(0));

}

TextFlow.flowComposer.updateAllControllers();

I hope that helps.

Regards,

Marcos

Abhi.G.Correct answer
Participating Frequently
June 25, 2009

You are better off importing the new markup and appending the children of the imported TextFlow to the existing TextFlow.

Abhishek

(Adobe Systems Inc.)