1 Reply Latest reply on Jun 17, 2009 7:34 AM by kglad

    Image pixelation

    Graphic Graeme Level 1

      I have an image called aboutus.png which I'm loading through XML into flash navigation.

       

      The image isbeing placed into a blank movieClip called "empty" but when the image loads in it looks pixelated and crappy.

      This is the code in flash that loads my image

       

      //Code in Flash//

       

      function loadXML(loadedX) {
          if (loadedX) {
              xmlNode = this.firstChild;
              image = [];
              total = xmlNode.childNodes.length;
          for (i=0; i<total; i++) {
              image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
          }
              load_pic();
          } else {
              content = "file not loaded!";
          }
      }

       

      xmlData = new XML();
      xmlData.ignoreWhite = true;
      xmlData.onLoad = loadXML;
      xmlData.load("images.xml");

       

      function load_pic(){
          k = Math.floor(Math.random()*total);
          picture_1.holder.loadMovie(image[k], 1);
      }

        • 1. Re: Image pixelation
          kglad Adobe Community Professional & MVP

          if you're resizing your image, enable its forceSmoothing property.  (and correct your code.)


           

          function loadXML(loadedX) {
              if (loadedX) {
                  xmlNode = this.firstChild;
                  image = [];
                  total = xmlNode.childNodes.length;
              for (i=0; i<total; i++) {
                  image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
              }
                  load_pic();
              } else {
                  content = "file not loaded!";
              }
          }

           

          xmlData = new XML();
          xmlData.ignoreWhite = true;
          xmlData.onLoad = loadXML;
          xmlData.load("images.xml");

           

          function load_pic(){
              k = Math.floor(Math.random()*total);
            // picture_1.holder.loadMovie(image[k], 1);

          picture_1.holder.loadMovie(image[k]);


          }