0 Replies Latest reply on Nov 23, 2010 7:09 AM by saariko

    how to import a richly formatted html text to textflow with importer?

    saariko Level 1

      hey all

       

      i am trying this:

       

      open google docs, new document, and type in:

      hello world

       

      (world bolded)

       

      then download it as html(zipped)

       

      i unzip the html file, and save it to the assets folder in src folder of my Flex app

       

      i have a Spark:TextArea instance and i want to do:

       

          var importer:ITextImporter = TextConverter.getImporter(TextConverter.TEXT_FIELD_HTML_FORMAT);

          myTextArea.textFlow = importer.importToFlow(htmlSource);

       

      where htmlSource should point to the saved html file somehow

       

      how do i do this? i tryed embedding, converting to ByteArrayAsset and to String, but i always get the source of the html file and not it's rendered rich text (ie "hello world).

       

      this is what i c at runtime:

       

      Untitled documentol{margin:0;padding:0}p{margin:0}.c0{color:#000000;font-size:11pt;font-family:Ari al;font-weight:bold}.c3{line-height:1.15;text-indent:0pt;direction:ltr}.c2{color:#000000;f ont-size:11pt;font-family:Arial}.c1{background-color:#ffffff}

      hello world

       

       

      am i clear?

      any help?

      thanx