3 Replies Latest reply on Feb 22, 2008 10:25 AM by jylaxx

    html file into a TextArea?


      I'm attempting to read an external html file into a TextArea. This works but there's too much white space and fonts and styles are no-go. (It's a fully complient html file with <html> <header> <body> etc. )

      <mx:HTTPService id="home" resultFormat="text" url="{Application.application.gHelpText}"

      <mx:TextArea x="10" y="10" htmlText. htmlText="{home.lastResult}" width="444" height="418" backgroundColor="#ffffff"/>

      Then I tried this which doesn't work at all.

      <mx:TextArea x="10" y="10" width="444" height="418" backgroundColor="#ffffff">

      Then I fiddled with the help example.

      <mx:TextArea id="myTextArea" initialize="myTextArea_initialize()"/>

      private function myTextArea_initialize():void {
      myTextArea.htmlText = {home.lastResult};

      Still no-go, any help appreciated.


        • 1. Re: html file into a TextArea?
          kcell Level 2
          Hi Paul,

          the html support of flex/flash is poor.
          You can replace some parts of the html with Regular expressions, but this is always just a hack. Also if you retrieve the html back from the TextArea it lost all the former known html tags and you might have to use again regular expressions to come to a valid html, which other software parts can understand.

          If you want a richtexteditor some people suggest to use fckeditor in a iframe (never used it, but it works).

          best regards,
          • 2. Re: html file into a TextArea?
            Gregory Lafrance Level 6
            Adobe AIR has a control that better supports HTML.
            • 3. Re: html file into a TextArea?
              TextField (basic component used by Label, Text, TextArea) support only a small subset of html tag. It is the only way to render text in Flash Player. So you have to consider to use it only for text internal to the application.
              BTW the html support would not be so poor if it was not buggy ;-)