What is the best way to display HTML in Flex?

I have HTML that includes characters such as the trademark "TM", as superscript (& trade;). In regular HTML, I would use "&trade;" or &#153; to display TrademarkTM. However, I cannot find a way to import HTML like this into Flex and display it correctly. I have similar problems with the <li> .

My HTML:

 <p>This information is intellectual property of My Company&#153;.</p> <p>Available features:</p> <li>Feature 1</li> <li>Feature 2</li> <li>Feature 3</li> <li>Feature 4</li> <p>COPYRIGHT INFORMATION:</p> <p>Copyright &#169; 2008, My Company. All rights reserved.</p> 

The only way I worked was to copy and paste the content directly into Flex:

 <mx:Text width="100%" height="100%"> <mx:htmlText> <![CDATA[ This information is intellectual property of My Companyβ„’. Available features: β€’ Feature 1 β€’ Feature 2 β€’ Feature 3 β€’ Feature 4 COPYRIGHT INFORMATION: Copyright Β© 2008, My Company. All rights reserved. ]]> </mx:htmlText> </mx:Text> 

I want to use an external HTML file that can be imported into my Flex application at runtime, so I don’t need to recompile the application to easily change the content.

I have heard about too many problems with the iFrame parameter, so I want to avoid this if possible.

Does anyone have any other good suggestions to solve this problem?

Thanks.

+7
html flex actionscript text
source share
2 answers

Ok, this is complicated. I just finished a project in which we used this open source library to display HTML: http://code.google.com/p/flex-htmlfilter

It processes lists, tables, etc., and is pretty easy to work with. But I do not think that it supports the trademark symbol. However, he supports some of the others.

I use it to output content from the CMS and display in my flash movie. He did a great job and allows me all the styling flexibility I need.

+1
source share

I don’t know if this is a good solution for all problems, but if you want to use the RichText control, you can load FlowText into it, which will allow you to use more HTML, including superscript and other glyphs, for example, which you want to use.

How to use super scripting in flex?

0
source share

All Articles