I'm looking to simply append the following text to an existing spark.components.TextArea
's text flow:
<b>something</b>: hello world
I have attempted to do this using the following code, but nothing happens:
this.textarea.textFlow.addChild(TextConverter.importToFlow(
"<b>something</b>: hello world",
TextConverter.TEXT_FIELD_HTML_FORMAT));
How can I accomplish this? I know in the old mx.controls.TextArea
component, I could simply do:
this.textarea.htmlText += "<b>something</b>: hello world";
How can I do this with the new TLF/FTE API expressed in the spark.components.TextArea
component?
I understand your pain with this one. This is the workaround I came up with:
Ultimately, you need to grab all the objects in the generated TextFlow. For simplicity, I'm not doing that here. But you see how I still iterate over all objects in the first and only paragraph in the generated TextFlow?
Hope this helps and good luck.
Another and ugly way to do could be : - Export the existing TextFlow into an HTML String. - Append to the another HTML String - Re-Import the Result