Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in displaying HTML in flex

 
Siddhesh Deodhar
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 (http://tinymce.moxiecode.com).

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 http://polygeek.com/2249_flex_display-html-text-in-the-spark-textarea.
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



 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
jp roberts
Greenhorn
Posts: 14
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic