Reputation: 145
I am trying to add an image to my textarea .Everything is fine but i am not getting why this code not works.
Here is my text area(mxml)::
<s:RichEditableText id="insultTxtArea" x="0" y="0" width="90%" height="100%"
color="#000000"
editable="false" fontFamily="Helvetica" selectable="true"
textFlow="{TextConverter.importToFlow( insultTxtArea.text, TextConverter.TEXT_FIELD_HTML_FORMAT )}"
styleName="customStyle"
textAlign="left" textDecoration="none"/>
I am adding an image
insultTxtArea.text = "<img src='assets\\insult500.png'>";
But where the fault is??? Thanks in advance
Upvotes: 1
Views: 71
Reputation: 729
Try this
<s:RichEditableText id="insultTxtArea">
<s:textFlow>
<s:TextFlow>
<s:img source="assets/insult500.png" width="auto" height="auto" />
</s:TextFlow>
</s:textFlow>
</s:RichEditableText>
Upvotes: 1
Reputation: 337
try:
insultTxtArea.textFlow = TextConverter.importToFlow("your html string",
TextConverter.TEXT_FIELD_HTML_FORMAT);
Upvotes: 1