<p>I have some HTML that is generated via a Rich Text Editor outside of my Flex application but would like to display it inside Flex. </p>

<p>The HTML is simple HTML tags, things like styles, anchors, and possibly image tags, is there a control that would let me render this HTML in flex or am I going to have to roll up my sleeves and roll my own?</p>

<p>Any ideas appreciated...Thanks.</p>

[{'answer_id': 51068, 'author': 'Raleigh Buckner', 'author_id': 1153, 'author_profile': 'https://Stackoverflow.com/users/1153', 'pm_score': 2, 'selected': False, 'text': '<p>If the HTML is <em>really</em> simple, you can display it in a normal label or textarea component, If it is more complex, I\'ll quote what I answered <a href="https://stackoverflow.com/questions/22909/is-there-some-way-to-show-html-content-inside-flash">in this question</a>. The discussion there also has a little more info.</p>\n<blockquote>\n<p>If it is complex HTML and Javascript, one possible way is <a href="http://drumbeatinsight.com/htmlcomponent" rel="nofollow noreferrer">HTMLComponent</a>, a method that uses an iframe over your flash to make it appear like the HTML is in your app. There are a few downsides to this method however - most of them described in detail <a href="http://www.deitte.com/archives/2008/07/dont_use_iframe.htm" rel="nofollow noreferrer">at Deitte.com</a>.</p>\n<p>If this can move offline, you could use Air (it has an mx:HTML component built in). <a href="http://www.deitte.com/archives/2008/07/an_air_version.htm" rel="nofollow noreferrer">Deitte.com</a> has a detail of this technique as well.</p>\n</blockquote>\n'}, {'answer_id': 51302, 'author': 'Theo', 'author_id': 1109, 'author_profile': 'https://Stackoverflow.com/users/1109', 'pm_score': 1, 'selected': False, 'text': '<p>Check out the documentation on <a href="http://livedocs.adobe.com/flex/2/langref/mx/controls/Label.html#htmlText" rel="nofollow noreferrer"><code>mx.controls.Label</code></a> and <a href="http://livedocs.adobe.com/flex/2/langref/flash/text/TextField.html#htmlText" rel="nofollow noreferrer"><code>flash.text.TextField</code></a> (which is what displays the text in a <code>Text</code> or <code>Label</code> control in Flex). The <code>TextField</code> documentation states that</p>\n\n<blockquote>\n  <p>The &lt;img&gt; tag lets you embed external image files (JPEG, GIF, PNG), SWF files, and movie clips inside text fields. Text automatically flows around images you embed in text fields. To use this tag, you must set the text field to be multiline and to wrap text.</p>\n</blockquote>\n\n<p>Which means that you can display an image in a <code>Text</code> component in Flex by setting its <code>htmlText</code> property to some HTML which contains an <code>&lt;img&gt;</code> tag. You can\'t use <code>Label</code>, because it is not multiline.</p>\n\n<p>I\'ve noticed that text fields have trouble with properly measuring their heights if the images displayed in them are left or right aligned with text flowing around them (e.g. <code>align="left"</code>). You may have to add some extra spacing below to counter that if you plan to use aligned images.</p>\n'}, {'answer_id': 400560, 'author': 'Niko Nyman', 'author_id': 36817, 'author_profile': 'https://Stackoverflow.com/users/36817', 'pm_score': 0, 'selected': False, 'text': '<p>@mmattax</p>\n\n<p>Indeed you can display images in a TextArea component. The approach <a href="http://aralbalkan.com/239" rel="nofollow noreferrer">is not entirely without problems though</a>...</p>\n'}, {'answer_id': 9993803, 'author': 'Adrian Pirvulescu', 'author_id': 129270, 'author_profile': 'https://Stackoverflow.com/users/129270', 'pm_score': 1, 'selected': False, 'text': '<p>You will have to use flex iFrame control.\nIt is not an 100% flash solutions, and combines a bit of js calls but works perfectly for me.</p>\n\n<p>You can grab latest source code from github <a href="https://github.com/flex-users/flex-iframe" rel="nofollow">https://github.com/flex-users/flex-iframe</a></p>\n\n<p>Here is some sample code from the component author.</p>\n\n<pre><code>&lt;!---\n    A basic example application showing how to embed a local html page in a Flex application.\n\n    @author Alistair Rutherford\n--&gt;\n&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" \n                xmlns:flexiframe="http://code.google.com/p/flex-iframe/"\n                horizontalAlign="center"\n                verticalAlign="middle"\n                viewSourceURL="srcview/index.html"&gt;\n\n    &lt;!-- Example project presentation --&gt;\n    &lt;mx:ApplicationControlBar dock="true"&gt;\n        &lt;mx:Text selectable="false"&gt;\n            &lt;mx:htmlText&gt;&lt;![CDATA[&lt;font color="#000000" size="12"&gt;&lt;b&gt;flex-iframe - Simple html example&lt;/b&gt;&lt;br&gt;This example shows how to embed a simple Html page in a Flex application.&lt;/font&gt;]]&gt;&lt;/mx:htmlText&gt;\n        &lt;/mx:Text&gt;\n    &lt;/mx:ApplicationControlBar&gt;\n\n    &lt;!-- HTML content stored in a String --&gt;\n    &lt;mx:String id="iFrameHTMLContent"&gt;\n        &lt;![CDATA[\n            &lt;html&gt;\n                &lt;head&gt;\n                    &lt;title&gt;About&lt;/title&gt;\n                &lt;/head&gt;\n                &lt;body&gt;\n                    &lt;div&gt;About&lt;/div&gt;\n                    &lt;p&gt;Simple HTML Test application. This test app loads a page of html locally.&lt;/p&gt;\n                    &lt;div&gt;Credits&lt;/div&gt;\n                    &lt;p&gt; &lt;/p&gt;\n                    &lt;p&gt;IFrame.as is based on the work of&lt;/p&gt;\n                    &lt;ul&gt;\n                      &lt;li&gt;&lt;a href="http://coenraets.org/" target="_top"&gt;Christophe Coenraets&lt;/a&gt;&lt;/li&gt;\n                      &lt;li&gt;&lt;a href="http://www.deitte.com/" target="_top"&gt;Brian Deitte&lt;/a&gt;&lt;/li&gt;\n                    &lt;/ul&gt;\n                &lt;/body&gt;\n            &lt;/html&gt;\n        ]]&gt;\n    &lt;/mx:String&gt;\n\n    &lt;!-- Example using the \'source\' property --&gt;\n    &lt;mx:Panel title="A simple Html page embedded with the \'source\' property"\n              width="80%"\n              height="80%"&gt;\n\n        &lt;flexiframe:IFrame id="iFrameBySource"\n                           width="100%"\n                           height="100%"\n                           source="about.html"/&gt;\n    &lt;/mx:Panel&gt;\n\n    &lt;!-- Example using the \'content\' property --&gt;\n    &lt;mx:Panel title="A simple Html page embedded with the \'content\' property"\n              width="80%"\n              height="80%"&gt;\n\n        &lt;flexiframe:IFrame id="iFrameByContent"\n                           width="100%"\n                           height="100%"\n                           content="{iFrameHTMLContent}"/&gt;\n    &lt;/mx:Panel&gt;\n\n&lt;/mx:Application&gt;\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/51013', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1638/']