This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Flex and the fly likes Problem in displaying HTML in flex Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Frameworks » Flex
Bookmark "Problem in displaying HTML in flex" Watch "Problem in displaying HTML in flex" New topic

Problem in displaying HTML in flex

Siddhesh Deodhar
Ranch Hand

Joined: Mar 05, 2009
Posts: 118
Hi all,

I want to display HTML in my flex application. HTML that I want to display is output of tinyMCE rich text area plugin (

Example of HTML text that i want to display is like follows

I tried using TextArea to display this HTML. I tried it using website
But the above HTML text does not gets displayed properly.

if HTML is in following format
<span color="#3333ff">testcolor</span>
Then it gets displayed properly using TextArea
but it fails if styles are used i.e.
<span style="color: #ff6600;">color</span>

Same is the case if I use htmlText="" atribute of <mx:text>.

Any other way in which i can display my HTML in Flex ? Mean time I am looking at how to change output format of HTML generated by TinyMCE

Good, Better, Best, Don't take rest until, Good becomes Better, and Better becomes Best.
Sidd : (SCJP 6 [90%] )
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Not really. Flex's support for HTML is very poor. If you need to display HTML I would consider a different technology. There are third party extensions to show HTML, but these will increase the size of your SWF considerably.

It is I think the bug/enhancement request with the biggest number of votes: see this.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
jp roberts

Joined: Feb 19, 2009
Posts: 14
Have you tried this,
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

You should be very aware of the caveats Adobe list in that control. It supports a very small subset of HTML elements, some are broken (the < img /> tag does not work properly, the cursor behaviour of <a / > is easily broken, the <font /> size attribute behaves differently from the spec. etc.) and included a tag not listed in the HTML spec. (the <textformat /> tag).

Basically, if rendering standards compliant HTML is an important aspect of your application, use a browser - don't use Flex.
I agree. Here's the link:
subject: Problem in displaying HTML in flex
jQuery in Action, 3rd edition