Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/02/2008, 15:19
Avatar de Sandino
Sandino
 
Fecha de Ingreso: octubre-2006
Mensajes: 277
Antigüedad: 17 años, 6 meses
Puntos: 1
Scroll bar dinamico + xml

Hola amigos estoy haciendo un scroll dinamico leido de un xml la cosa q en este scroll por ejemplo van a ir cuidades, y al hacer click en la cuidad aparece otro scroll donde van a ir las comunas.Todo bien en el primer Scroll de las cuidades, pero en el segundo scroll me muestra una sola comuna,habiendo varias.Espero me puedan ayudar!!!
este es el codigo del primer Scroll
Código HTML:

Objxml.onLoad = function ()
{
   var header, link;
   for (var i = 0; i < this.firstChild.childNodes.length; i++)
   {
      if (this.firstChild.childNodes[i].nodeName != null)
      {
         header = this.firstChild.childNodes[i].attributes.header;
         
         for (var j = 0; j < this.firstChild.childNodes[i].childNodes.length; j++)
         {
            if (this.firstChild.childNodes[i].childNodes[j].nodeName == "link")
            {
               link = this.firstChild.childNodes[i].childNodes[j].firstChild.nodeValue;
            }
         }
            arreglo.push (new struct (header, link));
      }
   }
   
   window = "";
   for (i = 0; i < arreglo.length; i++)
   {   
      indice= "<a href=\"asfunction:trac\">" + arreglo[i].header + "</a><br>";
      //window es el texto dinamico para el scroll
      window+=indice;
   }

};

Este es el codigo del segundo Scroll, donde esta el problema:
Código HTML:
function trac(index){
   trace(index)
}
indice= "<a href=\"asfunction:trac,"+i+"\">" + arreglo[i].header + "</a><br>";
      window+=indice;