1 Reply Latest reply on Apr 26, 2007 8:07 AM by Newsgroup_User

    XML and  images

    m10461
      Have a quick question. How can you load an image to a dynamic text box from xml

      using a txt file and loadvars if you have html tags it will display
      &photo1 = <img src="photo1.jpg"/>&done=-1

      var loadstuff = new LoadVars();
      loadstuff.onLoad = function(success) {
      if (success) {
      myphotobox.htmlText = this.photo1;
      }
      }

      in xml, even if you have the htm img src tag, it will just display the text and not the image

      descriptionbox.htmlText = true;
      myXML = new XML();
      myXML.load("sample.xml");
      myXML.ignoreWhite = true;
      myXML.onLoad = readus;

      function readus(){
      people = myXML.firstChild;
      personalphoto = election.firstChild;
      descriptionbox.text = personalphoto;
      }


      besides using a load movie is there anyway to put an image in a dynamic text box?

      thanks
        • 1. Re: XML and  images
          Level 7
          Hi,

          in the XML example you set the text property of the field instead of the
          HTMLText. Isn't that it?

          Manno

          m10461 wrote:
          > Have a quick question. How can you load an image to a dynamic text box from xml
          >
          > using a txt file and loadvars if you have html tags it will display
          > &photo1 = <img src="photo1.jpg"/>&done=-1
          >
          > var loadstuff = new LoadVars();
          > loadstuff.onLoad = function(success) {
          > if (success) {
          > myphotobox.htmlText = this.photo1;
          > }
          > }
          >
          > in xml, even if you have the htm img src tag, it will just display the text
          > and not the image
          >
          > descriptionbox.htmlText = true;
          > myXML = new XML();
          > myXML.load("sample.xml");
          > myXML.ignoreWhite = true;
          > myXML.onLoad = readus;
          >
          > function readus(){
          > people = myXML.firstChild;
          > personalphoto = election.firstChild;
          > descriptionbox.text = personalphoto;
          > }
          >
          >
          > besides using a load movie is there anyway to put an image in a dynamic text
          > box?
          >
          > thanks
          >

          --
          ----------
          Manno Bult
          http://www.aloft.nl
          manno@xs4all.nl