Problem with inserting HTML text into existing textFlow
So I have a spark textArea component, which has buttons to style it (bold, italic). I wish to have another button which performs the following function:
On clicking the button, the text that has been selected should get an icon placed in front of it.
So far, I have put this in the declarations:
<fx:Declarations>
<fx:String id="icon"><![CDATA[Works or not <img src="ico.png" width="14" height="7"/>]]></fx:String>
</fx:Declarations>
and I am using the:
reviewEditor.textFlow = TextConverter.importToFlow(tip,TextConverter.TEXT_FIELD_HTML_FORMAT); method.
However, the above method replaces the whole textarea content (obviously). I wish to insert the contents of "icon" in the textArea, at textarea.selectionAnchorPosition.
I have spent a lot of time looking online for a solution, and none of it seems to work. Some of it is half explained. I would really appreciate it, if someone could help me out with this.
Thanks in advance!
