1 Reply Latest reply on Mar 28, 2012 12:00 AM by aktell2007

    displying image imbeded with html text to RichText control

    v-Jay Level 1



         Is it possible to render an image embeded with html text in RichText controls.

      My requirement is that to use TextConverter.importToFlow() to set TextFlow to  RichText control.




      str:String="<b>hI</b> This is <i>test</i> <img source='assets/test.jpg' title='icon1' width='30' height='30'/> "
        richTxt.textFlow = TextConverter.importToFlow(str, TextConverter.TEXT_FIELD_HTML_FORMAT);
       id="richTxt" /> 

      The above code do not work for displaying image in html  text.


      It is possible using

      TextFlowUtil.importFromString() method but there are some other issues with this approach in handling tags like <b> , <i> and some other tags,  so i dropped to use this method.



      Please suggest the correct approach if any one know.




        • 1. Re: displying image imbeded with html text to RichText control
          aktell2007 Level 1

          Maybe this could help you in a way ! regards aktell2007





          package com.assets.EmbedScript {


              import flash.display.Sprite;

              import mx.core.BitmapAsset;


              public class WebSite extends Sprite {




                  private var WebSiteImg:Class;


                  public function WebSite() {




                      var image:BitmapAsset = new WebSiteImg();












                      import com.assets.EmbedScript.WebSite;


                      private var img01:WebSite;






          <img src="com.assets.EmbedScript.WebSite" width="16" height="16"/>