1 Reply Latest reply on Jul 26, 2006 5:57 AM by blemmo

    LoadVars

    rochribre1
      Hello;

      How I do to load and execute many ".txt" in the same var.

      var cont=1;
      while (cont <= 5){
      var arquivo2:LoadVars = new LoadVars();
      arquivo2.load(String("teste"+cont+".txt"));
      arquivo2.onLoad = function(){
      //function to be execute
      }
      cont = cont +1;
      }
        • 1. Re: LoadVars
          blemmo Level 1
          Maybe like this:

          function loadNext(){
          cont++;
          if (cont < 6){
          lv.load("teste"+cont+".txt");
          }
          }

          var cont = 0;
          var lv:LoadVars = new LoadVars();
          lv.onLoad = loadNext;
          loadNext(); // start loading

          But the next loaded text will replace the content of the LoadVars object, so you should save it before loading the next txt.

          hth,
          blemmo