0

In the .mxml file, we can easy create the RichEditableText (RET) component with content of image in it:

<s:RichEditableText id="ret" height="600" width="900" selectable="false" editable="false" click="onClick(event)">
    <s:content>
        <s:div>
            <s:p>
                <s:span>
                    This is a
                </s:span>
                <s:img source="@Embed('image.png')" />
                <s:span>
                    span test!
                </s:span>
            </s:p>
        </s:div>            
    </s:content>
</s:RichEditableText>

But if I want to create content of RET dynamically, such as

richEditableText.textFlow = TextConverter.importToFlow(textFlowStr, TextConverter.TEXT_FIELD_HTML_FORMAT);
richEditableText.textFlow = TextFlowUtil.importFromString(textFlowStr);
richEditableText.textFlow = TextConverter.importToFlow(textFlowStr, TextConverter.TEXT_LAYOUT_FORMAT)

It always give the exception. My textFlowStr is like this:

<img src="image.png" />  **for html format**
<img source="image.png" /> **for Text Layout Format**

In this How to add dynamically text and tags inside textFlow, it gives a example, but I try <img> it does not work.

This link says it support <img> tag. But I do not know how to use it?

Community
  • 1
  • 1
Liqun Sun
  • 125
  • 1
  • 1
  • 7
  • This should work. For example: `richEditableText.textFlow = TextConverter.importToFlow('', TextConverter.TEXT_FIELD_HTML_FORMAT);` Pick one approach for the import, show us that code, and show us the exception you get when it happens. – Sunil D. Jun 07 '13 at 19:41
  • Which exception do you get? – Nemi Jan 17 '14 at 16:34

0 Answers0