gabi
gabi

Reputation: 15

render html in flex 4 (web) without an iframe

I know this question was asked before, but none of the solutions work properly. How do I render a basic html in flex 4 without an iframe? I saw textarea renders some weird format that would suffice if it would work.

For example I wan't to add an image like this

text_area.htmlText += "<img src='...' />";

then 1. I press enter 2. I add the image again like above, I get the img tag inserted 10 times or so; which is weird (but not funny at all). All things being equal, html is a much normal approach, is there a basic renderer for flex 4 that works ok? Thanks

Upvotes: 0

Views: 1133

Answers (1)

J_A_X
J_A_X

Reputation: 12847

You'll want to use either RichText or RichEditableText component to show your html using TLF. You'll want to do something like this:

<s:RichText textFlow="{TextConverter.importToFlow(yourHtmlString, TextConverter.TEXT_FIELD_HTML_FORMAT)}" />

However, you should know that if you have a lot of html, the conversion is going to take longer.

Upvotes: 1

Related Questions