Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/07/2004, 03:03
Enea
 
Fecha de Ingreso: junio-2003
Mensajes: 744
Antigüedad: 20 años, 9 meses
Puntos: 0
Solo obtengo la primera línea de un listado XML

Buenas, he conseguido sacar una línea de registro de mi base de datos por medio de XML.

Pero no sé como hacer para sacarlas todas, quiero conseguir un listado de registros uno debajo de otro.

He probado de hacer un bucle for pero no me sale :( Mirando por Inet he encontrado algo de duplicateMovieClip pero no sé si tiene mucho sentido porque no hay ningun Movie Clip en mi película.

Os paso el código que tengo hasta ahora a ver si me podeis echar una mano..

Código:
//Declara la variable obj_xml como un objeto xml
var obj_xml:XML=new XML();
//Permite colocar espacios
obj_xml.ignoreWhite=true;
//Función que se ejecuta en el momento en el que flash cargue el xml
obj_xml.onLoad=function(exito) {
	//La variable exito será true si no ha habido ningun error y false si lo ha habido.
	if (exito) 
	{
		Referencia.text=obj_xml.firstChild.childNodes[0].firstChild.nodeValue;
		Tipo_inmueble.text=obj_xml.firstChild.childNodes[1].firstChild.nodeValue;
		Provincia.text=obj_xml.firstChild.childNodes[2].firstChild.nodeValue;
		Localidad.text=obj_xml.firstChild.childNodes[3].firstChild.nodeValue;
		Zona.text=obj_xml.firstChild.childNodes[4].firstChild.nodeValue;
		M_Utiles.text=obj_xml.firstChild.childNodes[5].firstChild.nodeValue;
		M_Terreno.text=obj_xml.firstChild.childNodes[6].firstChild.nodeValue;
		Garaje.text=obj_xml.firstChild.childNodes[7].firstChild.nodeValue;
		Jardin.text=obj_xml.firstChild.childNodes[8].firstChild.nodeValue;
		Piscina.text=obj_xml.firstChild.childNodes[9].firstChild.nodeValue;
		Ascensor.text=obj_xml.firstChild.childNodes[10].firstChild.nodeValue;
		Trastero.text=obj_xml.firstChild.childNodes[11].firstChild.nodeValue;
		Terraza.text=obj_xml.firstChild.childNodes[12].firstChild.nodeValue;
		Sotano.text=obj_xml.firstChild.childNodes[13].firstChild.nodeValue;
		Habitaciones.text=obj_xml.firstChild.childNodes[14].firstChild.nodeValue;
		Baños.text=obj_xml.firstChild.childNodes[15].firstChild.nodeValue;	
		Aire_Acondicionado.text=obj_xml.firstChild.childNodes[16].firstChild.nodeValue;
		Descripcion.text=obj_xml.firstChild.childNodes[17].firstChild.nodeValue;
		Precio.text=obj_xml.firstChild.childNodes[18].firstChild.nodeValue;
		Novedad.text=obj_xml.firstChild.childNodes[19].firstChild.nodeValue;
	}
	else 
	{
		trace ("Error");
	}
};

//Esta es la función que llma el botón

function cargarXML()
{
obj_xml.load("Bdd.xml");
}
__________________
Ibisof | Saludos desde Eivissa !!! :p