Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/01/2010, 20:52
Bluesman74cl
 
Fecha de Ingreso: marzo-2003
Ubicación: onde toy?
Mensajes: 1.437
Antigüedad: 21 años, 1 mes
Puntos: 9
XML + Loop + noticias e imagenes

Que tal estimados:
Con harto trabajo estoy haciendo un banner?!! algo asi, el caso es que
tengo una capa en donde tengo un mc que carga imagenes de forma random
luego tengo otra capa muy parecida pero que carga noticias que deberían ir cambiando cada vez que cambia la imagen.


El tema es que no logro hacer que cuando vuelve al frame 1 me incremente el indice
teno lo siguiente:

Código:
imagenes_mc.loadMovie("img/ima00" + (1+random(10)) + ".jpg");
System.useCodepage = true; 
var indice:Number; 
var noticias_xml:XML; 
function cargarDatos(_indice:Number){
		var fecha:String;
		var titulo:String;
		var mensaje:String;
		var imagen:String;
		fecha = noticias_xml.firstChild.childNodes[_indice].attributes.fecha;
		titulo = noticias_xml.firstChild.childNodes[_indice].firstChild.firstChild.nodeValue;
		mensaje = noticias_xml.firstChild.childNodes[_indice].firstChild.nextSibling.firstChild.nodeValue
		imagen = noticias_xml.firstChild.childNodes[_indice].lastChild.firstChild.nodeValue
		_root.mensaje_txt.htmlText = "<font color='#FFFFFF' size='10'>Publicado: " + fecha + "</font></p>";
		_root.mensaje_txt.htmlText += "<p align='left'><font color='#FFFFFF' size='16'><b>" + titulo + "</b></font></p>";
		_root.mensaje_txt.htmlText += "<p><font size='11'>" + mensaje + "</font>";
		_root.mensaje_txt.htmlText += "";
		_root.pantalla_mc.loadMovie(imagen);	
	}


indice=0; 
noticias_xml = new XML();
noticias_xml.ignoreWhite = true;
noticias_xml.load("url de mi sitio");

noticias_xml.onLoad = function(){
			cargarDatos(indice);			
}

if(noticias_xml.firstChild.childNodes[indice+1] != null){
	indice++;
	cargarDatos(indice);
}
	trace(indice+1);

Como le puedo hacer para que incremente el indice para moverme dentro del XML??

desde ya mil gracias
__________________
Buena Vida...
Francisco