5 Replies Latest reply on Mar 19, 2007 1:53 PM by kglad

    setInterval problem

      I have names in some text files split up alphabetically by every 3 letters (abc, def, ghi, etc.). I'm using a slider to navigate between the different files. When it loads in initially via frame script it works fine. Here is my code:


      function checkParamsLoaded() {
      if (name1 == "test name") {
      trace("not yet.");
      } else {
      trace("finished loading. killing interval.");


      for (i=1; i<=NumNames;i++) { // Text file sample entry below:
      names = eval("name"+i); // &name1=Abbot, Joseph
      = eval("nameID"+i); // &nameID1=295
      BioExists = eval("BioExists"+i); // &BioExists1=0
      } // &NumNames=52

      slot1_name = names[1]; // display each name in one of the 7 slots
      slot2_name = names[2];
      slot3_name = names[3];
      slot4_name = names[4];
      slot5_name = names[5];
      slot6_name = names[6];
      slot7_name = names[7];
      link1 = nameID[1]; // set the nameID key for each so we know whose bio to feature if selected
      link2 = nameID[2];
      link3 = nameID[3];
      link4 = nameID[4];
      link5 = nameID[5];
      link6 = nameID[6];
      link7 = nameID[7];

      var param_interval:Number = setInterval(checkParamsLoaded, 1000);

      This works fine. The problem comes when I try to load the def, ghi, jkl, or some other text file that I call from a slider control movie clip. The new data loads, but every second it keeps reloading. Makes it impossible to sroll thru the displayed names. Here is my call to this function from the slider movie clip:


      setInterval(_root.checkParamsLoaded, 1000);

      It seems to keep reloading the names every second. When I change the setInterval number to 10000, it reloads the data every 10 seconds. It doesn't seem to be clearing the interval and just keeps reloading all the time. Is how I'm stating the setInterval from the slider movie clip wrong?