2 Replies Latest reply on Jul 17, 2006 11:05 AM by ratamaster

    eval() function problem

    ratamaster
      Hi.
      I have the next code and it works:

      if (success) {
      var mytotal=this.total;
      for (i=0; i<=mytotal-1; i++) {
      pic_arr.push(eval("this.foto" add i));
      link_arr.push("noticias/vernoticia.php?notid="+eval("this.id_noticia" add i));
      noticia_arr.push(eval("this.news" add i));
      }
      }

      As you can see I use the eval() function. This script loads variables from a php file. But it just works for mozilla and not for IE, I publish the movie as a flash6 movie. I read that eval may have incompatibility with IE so I would like to change to array sintax, I did it but didn't work:

      if (success) {
      var mytotal=this.total;
      for (i=0; i<=mytotal-1; i++) {
      pic_arr.push(this["this.foto" + i]);
      link_arr.push("noticias/vernoticia.php?notid="+this["this.id_noticia" +i]);
      noticia_arr.push(this["this.news" +i]);
      }
      }

      Can anyone tell me how to do it right??