0 Replies Latest reply on Aug 15, 2006 8:38 AM by marcofella

    Loadvars Undefined?

    marcofella
      I’m having a few problems with some actionscript. Basically when I test the SWF file without it being embedded in an HTML file (just by testing it in Flash itself) it formats the number perfectly. However when I place the file in an HTML page it returns an ‘undefined’ response to the variable I am getting from a remote server.

      The actionscript is all placed in the first frame of the movie. And is as follows:

      function writePledges() {
      txtPledges.text=container.TotalPledges;
      }
      function writePledgesXX(){
      var iPledges=parseInt(container.TotalPledges);
      if (iPledges==null || isNaN(iPledges)) {
      txtPledges.text="0";
      }
      else {
      txtPledges.text=iPledges;
      if (iPledges>=2000 && iPledges<3000) {
      gotoAndPlay("num2000");
      }
      if (iPledges>=3000 && iPledges<4000) {
      gotoAndPlay("num3000");
      }
      if (iPledges>=4000 && iPledges<5000) {
      gotoAndPlay("num4000");
      }
      if (iPledges>=5000 && iPledges<6000) {
      gotoAndPlay("num5000");
      }
      if (iPledges>=6000 && iPledges<7000) {
      gotoAndPlay("num6000");
      }
      if (iPledges>=7000 && iPledges<8000) {
      gotoAndPlay("num7000");
      }
      if (iPledges>=8000 && iPledges<9000) {
      gotoAndPlay("num8000");
      }
      if (iPledges>=9000 && iPledges<10000) {
      gotoAndPlay("num9000");
      }
      if (iPledges>=10000) {
      gotoAndPlay("num10000");
      }
      }
      }
      var container:LoadVars = new LoadVars();
      container.load(" http://arieluk.ariel.info:3037/cgibin/nautilus/nautiluspledge.pl?GetTotal=true");
      container.onLoad = writePledges;


      The SWF will be hosted at a different place to where it will be getting the variable.

      Any help would be great. Thanks.

      Marco
      Text