8 Replies Latest reply on Jan 1, 2007 2:17 PM by kglad

    infinity with preloader

    maxdido Level 1
      I noticed something strange !!!
      When I view my site on a computer with flash version 8.0.24 the preloader works perfect. the percentage is shown from 0 too 100%. But when I go to a computer with flash version 8.0.34 or higher(v9) I get infinity%?
      Isn't this strange?

      this is the code in frame 1:

      function loadXML(loaded) {
      if (loaded) {
      xmlNode = this.firstChild;
      image = [];
      description = [];
      dimensionX = [];
      total = xmlNode.childNodes.length;
      for (i=0; i<total; i++) {
      image = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
      description = xmlNode.childNodes.childNodes[1].firstChild.nodeValue;
      dimensionX = xmlNode.childNodes.childNodes[2].firstChild.nodeValue;
      }
      firstImage();
      } else {
      content = "file not loaded!";
      }
      }
      xmlData = new XML();
      xmlData.ignoreWhite = true;
      xmlData.onLoad = loadXML;
      xmlData.load("portfolio-landscapes.xml");
      /////////////////////////////////////
      p = 0;
      /////////////////////////////////////

      /////////////////////////////////////
      /*this.onEnterFrame = function() {
      filesize = imageholder.mcimage.getBytesTotal();
      loaded = imageholder.mcimage.getBytesLoaded();
      percentage = Math.floor((loaded/filesize)*100);
      preloader._visible = true;
      if (loaded != filesize) {
      preloader.progressbar._xscale = percentage;
      // set the percentage dynamic textfield
      preloader.progresstxt.perc.text = percentage+"%";
      }
      else if (loaded == filesize){
      preloader._visible = false;
      // done loading image so now we can resize.
      // centerpoint of the movieclip "mcimage" to be set as you wish.
      mcimageX = 380;
      mcimageY = 245;
      // now we get the size of the image
      imgwidth = imageholder.mcimage._width;
      imgheight = imageholder.mcimage._height;
      // finally, set new _x and _y position to center the image to the centerpoint
      imageholder.mcimage._x = mcimageX-(imgwidth/2);
      imageholder.mcimage._y = mcimageY-(imgheight/2);
      if (_root.win._width == _root.w && imageholder._alpha<100) {
      imageholder._alpha += 10;
      }
      }
      };*/
      //////////////////////////////////////////
      function nextImage() {
      if (p<(total-1)) {
      p++;
      // 160 = 145 menubalk + 5 kader links + 2x witrand rondom de foto's
      _root.w = Number(dimensionX[p])+160;
      imageholder._alpha = 0;
      imageholder.mcimage.loadMovie(image[p], 1);
      mcinfo.desc_txt.text = description[p];
      picture_num();
      preloadthing();
      }
      }
      function prevImage() {
      if (p>0) {
      p--;
      _root.w = Number(dimensionX[p])+160;
      imageholder._alpha = 0;
      imageholder.mcimage.loadMovie(image[p], 1);
      mcinfo.desc_txt.text = description[p];
      picture_num();
      preloadthing();
      }
      }
      function firstImage() {
      imageholder.mcimage.loadMovie(image[0], 1);
      mcinfo.desc_txt.text = description[0];
      _root.w = Number(dimensionX[0])+160;
      imageholder._alpha = 0;
      picture_num();
      preloadthing();
      }
      function picture_num() {
      current_pos = p+1;
      mcinfo.pos_txt.text = current_pos+"/"+total;
      }
      /////////////////////////////
      function preloadthing() {
      this.onEnterFrame = function() {
      filesize = imageholder.mcimage.getBytesTotal();
      loaded = imageholder.mcimage.getBytesLoaded();
      percentage = Math.floor((loaded/filesize)*100);
      preloader._visible = true;
      if (loaded != filesize && loaded > 0) {
      preloader.progressbar._xscale = percentage;
      // set the percentage dynamic textfield
      preloader.progresstxt.perc.text = percentage+"%";
      }
      else if (loaded == filesize && filesize > 0){
      preloader._visible = false;
      // done loading image so now we can resize.
      // centerpoint of the movieclip "mcimage" to be set as you wish.
      mcimageX = 380;
      mcimageY = 245;
      // now we get the size of the image
      imgwidth = imageholder.mcimage._width;
      imgheight = imageholder.mcimage._height;
      // finally, set new _x and _y position to center the image to the centerpoint
      imageholder.mcimage._x = mcimageX-(imgwidth/2);
      imageholder.mcimage._y = mcimageY-(imgheight/2);
      if (_root.win._width == _root.w && imageholder._alpha<100) {
      imageholder._alpha += 10;
      }
      }
      }
      }

      WHAT AM I DOING WRONG ????
      Thanks,
      Max.
        • 1. Re: infinity with preloader
          maxdido Level 1
          It's still not working with my latest attemp under IE. With Firefox it works. This I find so strange, preloader in IE doesn't work and with firefox it's oke?

          this is what I have done so far:

          function loadXML(loaded) {
          if (loaded) {
          xmlNode = this.firstChild;
          image = [];
          description = [];
          dimensionX = [];
          total = xmlNode.childNodes.length;
          for (i=0; i<total; i++) {
          image = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
          description = xmlNode.childNodes.childNodes[1].firstChild.nodeValue;
          dimensionX = xmlNode.childNodes.childNodes[2].firstChild.nodeValue;
          }
          firstImage();
          } else {
          content = "file not loaded!";
          }
          }
          xmlData = new XML();
          xmlData.ignoreWhite = true;
          xmlData.onLoad = loadXML;
          xmlData.load("portfolio-landscapes.xml");
          /////////////////////////////////////
          p = 0;
          /////////////////////////////////////
          function nextImage() {
          if (p<(total-1)) {
          p++;
          _root.w = Number(dimensionX[p])+160;
          mcinfo.desc_txt.text = description[p];
          picture_num();
          preloadthing();
          }
          }
          function prevImage() {
          if (p>0) {
          p--;
          _root.w = Number(dimensionX[p])+160;
          mcinfo.desc_txt.text = description[p];
          picture_num();
          preloadthing();
          }
          }
          function firstImage() {
          mcinfo.desc_txt.text = description[0];
          _root.w = Number(dimensionX[0])+160;
          picture_num();
          preloadthing();
          }
          function picture_num() {
          current_pos = p+1;
          mcinfo.pos_txt.text = current_pos+"/"+total;
          }
          // --------------------------------------------------------------------------------------
          function preloadthing() {
          var mcloader = new MovieClipLoader();
          listener = new Object();
          listener.onLoadStart = function (targetmc) {
          // set preloader to visible + mcprogressbar._width to zero
          _root.mccontent.preloader.progressbar._visible = true;
          _root.mccontent.preloader.progresstxt._visible = true;
          _root.mccontent.preloader.progressbar._xscale = 0;
          _root.mccontent.preloader.progresstxt.perc.text = "0%";
          };
          // loading progress......
          listener.onLoadProgress = function (targetmc, bytesLoaded, bytesTotal) {
          // get the loaded and total bytes and scale the progressbar
          _root.mccontent.preloader.progressbar._xscale = Math.floor((bytesLoaded/bytesTotal)*100);
          // set the dynamic textfield
          _root.mccontent.preloader.progresstxt.perc.text = Math.floor((bytesLoaded/bytesTotal)*100)+"%";
          };
          listener.onLoadInit = function (targetmc) {
          _root.mccontent.preloader.progressbar._visible = false;
          _root.mccontent.preloader.progresstxt._visible = false;
          // done loading image so now we can resize.
          // centerpoint of the movieclip "mcimage" to be set as you wish.
          mcimageX = 380;
          mcimageY = 245;
          // now we get the size of the image
          imgwidth = imageholder.mcimage._width;
          imgheight = imageholder.mcimage._height;
          // finally, set new _x and _y position to center the image to the centerpoint
          imageholder.mcimage._x = mcimageX-(imgwidth/2);
          imageholder.mcimage._y = mcimageY-(imgheight/2);
          if (_root.win._width == _root.w && imageholder._alpha<100) {
          imageholder._alpha += 10;
          }
          };
          // add listener
          mcloader.addListener(listener);
          // load .swf file
          mcloader.loadClip(image[p], _root.mccontent.imageholder.mcimage);
          }

          Any idees why it's not working for me?
          • 2. Re: infinity with preloader
            kglad Adobe Community Professional & MVP
            is your image loading with both?
            • 3. Re: infinity with preloader
              maxdido Level 1
              yes, both get the picture loaded
              • 4. Re: infinity with preloader
                kglad Adobe Community Professional & MVP
                i don't see an infinty% on your site and i'm using an ie equivalent (maxthon) with flash player 9. though it loads to so fast it's hard to see much more than a few numbers followed by a percent sign zip past.
                • 5. Re: infinity with preloader
                  maxdido Level 1
                  The good
                  - firefox works perfect with flash 9.0.28
                  - maxthon works perfect with flash 9.0.28
                  - IE 6 works perfect with flash 8.0.24

                  The bad
                  - IE 6 with flash 8.0.34, I see infinity
                  - IE 7 with flash 9.0.28, I see infinity

                  • 6. infinity with preloader
                    maxdido Level 1
                    look at THIS to see what I see
                    You can also see the site here.
                    goto portfolio --> landscapes --> picture 6 is a very large picture of more then 1 MB.
                    • 7. Re: infinity with preloader
                      maxdido Level 1
                      Guess what......

                      I found it.
                      It's my zonealarm security suite firewall.
                      When I shut it down I see the percentages and when I turn it back on I see infinity.

                      But it's still weird because firefox has no problems with it even when the firewall is up and running.
                      Thanks for the help.
                      Max.
                      • 8. Re: infinity with preloader
                        kglad Adobe Community Professional & MVP
                        that's pretty strange. i can't imagine what za is blocking in ie with those two player versions that it's not blocking for everything else.