Thursday, April 1, 2010

Flex 4: HTML support where art thou?

Flex 3 has mx:TextField, Air has mx:HTML but Flex 4 is only left with s:TextConverter which hardly matches up in terms of taking an HTML string and converting it into something that Flex can render. The gap in functionality is astounding. Follow this forum post for more details.

Also, if you need it, I found a great article that talks about stripping tags that cannot be processed anyway by the TextConverter engine: Strip Html Tags – with allowable tags

There are two different schools of thought on workarounds:
  1. Write your own html to flex converters
    1. Better HTML support for Adobe Flex 3 / Actionscript 3 / Flash
    2. HTML and Flex
  2. Use the iFrame trick
    1. Mixing HTML and Flex using IFrame
    2. FLEX – i – FRAME
    3. Finally Updated: Embedding HTML in a Flex application using an IFrame
  3. There's even an article listing the cons for one the iFrame approach: Don't Use IFrames for HTML in Flex