5 Replies Latest reply on Sep 23, 2006 3:24 AM by Newsgroup_User

    images from database in htmlText

    Level 7

      Hi all,

      Correct me if I'm wrong (please) but I can't seem to find a way to load
      a textField with htmlText in which a request to a php-script is placed
      to show an image. Google is not my friend in this one either...
      I try something like:

      display_txt.htmlText = "<html>" +
      "<head>" +
      "</head>" +
      "<body>" +
      "<img src=\"showimage.php?imageid=7&thumbnail=1\">" +
      "</p>" +
      "</body>" +
      "</html>";

      It works fine if I let it piont to a file physically present on disk like:

      "<img src=\"pic.jpg\">" +

      I know about using the identifier of a library item in the image tag,
      but that's not what I'm looking for. Unless someone can come up with
      some wizardry to load an external image in a library item not on stage.


      --
      ----------
      Manno Bult
      manno@xs4all.nl
        • 1. Re: images from database in htmlText
          Level 7
          I take that as a 'No' :)

          Manno Bult wrote:
          >
          > Hi all,
          >
          > Correct me if I'm wrong (please) but I can't seem to find a way to load
          > a textField with htmlText in which a request to a php-script is placed
          > to show an image. Google is not my friend in this one either...
          > I try something like:
          >
          > display_txt.htmlText = "<html>" +
          > "<head>" +
          > "</head>" +
          > "<body>" +
          > "<img src=\"showimage.php?imageid=7&thumbnail=1\">" +
          > "</p>" +
          > "</body>" +
          > "</html>";
          >
          > It works fine if I let it piont to a file physically present on disk like:
          >
          > "<img src=\"pic.jpg\">" +
          >
          > I know about using the identifier of a library item in the image tag,
          > but that's not what I'm looking for. Unless someone can come up with
          > some wizardry to load an external image in a library item not on stage.
          >
          >

          --
          ----------
          Manno Bult
          manno@xs4all.nl
          • 2. Re: images from database in htmlText
            TimSymons Level 1
            Manno,

            The <img> tag in Flash does not support what you are trying to do (well it does but not the way you implemented it).

            I would recommend that you first make a call to the PHP script with the LoadVars() class to get the path to the image file. Then use that information in the AS script you provided.

            Also, you don't need the <HTML>, <HEAD> or <BODY> tags in the HTML for Flash.

            Tim
            • 3. Re: images from database in htmlText
              Level 7
              Tim,

              Thanks for the tips.
              Lucky for me it's a project to be so I can still figure out how to do it
              exactly. I was just hoping to be able to reuse some cms stuff I have
              laying around in which the files are in blobs in a mysql database, so
              there is no path to request.
              Maybe write out temp-files for each request (yugh!) or just not store 'm
              in the database for this one...

              kind regards,
              Manno

              TimSymons wrote:
              > Manno,
              >
              > The <img> tag in Flash does not support what you are trying to do (well it
              > does but not the way you implemented it).
              >
              > I would recommend that you first make a call to the PHP script with the
              > LoadVars() class to get the path to the image file. Then use that information
              > in the AS script you provided.
              >
              > Also, you don't need the <HTML>, <HEAD> or <BODY> tags in the HTML for Flash.
              >
              > Tim
              >

              --
              ----------
              Manno Bult
              manno@xs4all.nl
              • 4. Re: images from database in htmlText
                TimSymons Level 1
                You might be able to you the Bitmap class. I have never used it so I do not have any help for you there but I know it can do some really cool stuff which include writing image files out and sending them to PHP. So you might be able to do the reverse but you would have to have a routine to convert the binary data into the image.

                Tim
                • 5. Re: images from database in htmlText
                  Level 7
                  Thanks, I'll look in to it. Never done anything else but load library
                  data with it and I know that was only skimming the surface.

                  Manno

                  TimSymons wrote:
                  > You might be able to you the Bitmap class. I have never used it so I do not
                  > have any help for you there but I know it can do some really cool stuff which
                  > include writing image files out and sending them to PHP. So you might be able
                  > to do the reverse but you would have to have a routine to convert the binary
                  > data into the image.
                  >
                  > Tim
                  >

                  --
                  ----------
                  Manno Bult
                  manno@xs4all.nl