2 Replies Latest reply on Apr 29, 2006 6:51 AM by mrmille

    need some kind of dynamic variables/globals =)

    mrmille
      Im creating a pretty advanced "split-down-strings-to-arrays" page and got the idea of making it dynamic in flash. This is clearly possible, however one want to make it as neat and sweet as possible. Thus...

      I got some functions...

      -----------------
      myLoadVars = new LoadVars();
      myLoadVars.onLoad = function(loaded:Boolean) {
      if (loaded) {
      weatherArray = this.var1.split("~"); // splits the mainstring
      } else {
      trace("loading failed");
      }
      };

      checkIfLoaded = function(){
      if(myLoadVars.loaded){
      clearInterval(checking)
      trace("Loadvars is loaded")

      var a:Number = 10;
      while (a >= 0) {

      var spMupp[a]:Array = weatherArray[a].split(";"); // <<< this one needs to be dynamic

      trace(a+ "=" + weatherArray[a]);
      a--;

      } // while (a >= 0) {

      } // if(myLoadVars.loaded){

      } // checkIfLoaded = function(){

      myLoadVars.load("params.txt");

      ---------------------------

      The thing gets wierd after
      var spMupp+a:Array = weatherArray[a].split(";");

      Its the [a], i know. I've declared new arrays and strings in similiar ways before, i just cant remember how =(
      The spMupp+a should be available as different arrays, like spMupp0:Array & spMupp1:array

      Oh, and the contents of the params.txt is
      var1="2006-04-28 12:01:00;3,8;8~2006-04-28 12:31:00;5,5;8~2006-04-28 13:01:00;4,1;8~2006-04-28 13:32:00;3,1;8~2006-04-28 14:02:00;3,3;8~2006-04-28 14:31:00;3,6;1~2006-04-28 15:00:00;3,6;8~2006-04-28 15:32:00;3,0;8~2006-04-28 16:02:00;3,7;8~2006-04-28 16:31:00;4,1;1~2006-04-28 17:00:00;3,6;1~"

      Please help!