3 Replies Latest reply on Dec 3, 2008 8:49 AM by Cesare Rocchi

    Loading image into mx:html using htmlText

    Jared Langdon Level 1
      How does one reference files like images when using an mx:html tag and the htmlText property? Here's the basic idea:

      private var strHtmlText:XML =
      <img width="100px" height="100px" alt="image" src="foo.jpg" />
      <mx:HTML width="800" height="800" htmlText="{strHtmlText.toString()}" />

      This doesn't work. The image doesn't appear but the alt text does. I tried playing with the value in the src attribute of the image object in the html string to no avail. I tried app:foo.jpg, app:/foo.jpg, app://foo.jpg, and /foo.jpg. I event tried @Embed(source='foo.jpg'). I have copies of foo.jpg in the project root, the src directory, and in bin-debug. Nothing works. I feel a bit silly posting this because it must be obvious, but I've searched and searched for the answer with no luck. Thanks.