Comunidad de diseño web y desarrollo en internet online

XML Navegable

Citar            
MensajeEscrito el 09 Jun 2005 02:31 pm
HOla.
Bueno respecto a este codigo tengo 1 consultas.

1. EL "next_mc.onPress=function(){" Es un botón con el cual avanzo en forma ascendente logrando navegar por los nodos. No pude hacer que el otro btn que retroceda funcione.
KOMO PUEDO HACERLO??


Código :


var nodo= 0;
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.load("fuentedatos/productos.xml");
//btr
my_xml.onLoad = function() {
   productos=this.firstChild.childNodes.length;
}
next_mc.onPress=function(){
ficha_mc.nombre_txt.text=my_xml.firstChild.childNodes[nodo].childNodes[0].firstChild;
ficha_mc.precio_txt.text=my_xml.firstChild.childNodes[nodo].childNodes[1].firstChild;
ficha_mc.mail_txt.text=my_xml.firstChild.childNodes[nodo].childNodes[2].firstChild;
ficha_mc.fono_txt.text=my_xml.firstChild.childNodes[nodo].childNodes[3].firstChild;
ficha_mc.letra_txt.text=my_xml.firstChild.childNodes[nodo].childNodes[4].firstChild;
nodo++;


if(nodo>=productos){
   nodo=0;
}
}


Ok, Gracias :wink:

Por echoes

57 de clabLevel



 



Ultima edición por echoes el 10 Jun 2005 04:28 pm, editado 4 veces

msie
Citar            
MensajeEscrito el 09 Jun 2005 02:39 pm
Pues hombre, creo que:

Código :

if(nodo>0){
  nodo--;
}


puede dar resultado...

Saludos.

Por ExGaul

Claber

180 de clabLevel



Genero:Masculino  

Cereté - Colombia

msie

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.