开发者

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 t开发者_开发问答hings being equal, html is a much normal approach, is there a basic renderer for flex 4 that works ok? Thanks


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜