3 Replies Latest reply on Dec 6, 2006 10:33 AM by kglad

    LoadVars in Loop Acting Weird

    cinemaguy Level 1
      Well typically I am on here solving others problems but I have run into
      a weird one of my own so maybe you guys could help me out. I have a
      simple PHP script that returns to me the number of files in a paticular
      folder. In this case Jpegs. I can trace the number of files perfectly
      but as soon as I stick it in my loop it breaks. Any ideas are

      var thelv:LoadVars = new LoadVars();
      thelv.onLoad = function() {
      var theJpegCount:Number;
      theJpegCount = thelv.thecount;
      trace(theJpegCount); // Traces perfectly
      for (var n=maxNumOfPrefPics; n<theJpegCount; n++) {
      maxPicsArray[n-maxNumOfPrefPics] = n;
      } }
      As an addendum all my variables have been properly defined in another
      external AS file that is included in the first line on the first frame
      of my movie so that is not the issue. I just figured I would get some
      responses that said my variables are not properly defined. I can "hard
      code" a number in the loop...

      ex: for (var n=maxNumOfPrefPics; n<150; n++)

      and it works perfectly but no luck with my JpegCount that will trace
      out the number one line before...

      ex: trace(theJpegCount); // returns 150
      for (var n=maxNumOfPrefPics; n<theJpegCount; n++) // does not work

      ok. thanks guys.