Ver Mensaje Individual
  #8 (permalink)  
Antiguo 13/06/2005, 11:37
Avatar de Bandit
Bandit
Moderador
 
Fecha de Ingreso: julio-2003
Ubicación: Lima - Perú
Mensajes: 16.726
Antigüedad: 20 años, 9 meses
Puntos: 406
Este es el código en el primer frame del Flash, con el cual me carga los links a las noticias:
function cargaXML() {
var primerNivel = this.firstChild;
var noticias = primerNivel.childNodes;
var posicionY = 65;
noticias.reverse();
total = noticias.length;
for (x in noticias) {
noticia = noticias[x].firstChild;
duplicateMovieClip("plantilla", "titular"+x, x);
_root["titular"+x].titular = noticia.nodeValue;
_root["titular"+x].direccion = noticias[x].attributes.url;
_root["titular"+x]._y = posicionY;
posicionY += 25;
}
limpiaXML();
}
function limpiaXML() {
delete primerNivel;
delete noticias;
delete noticia;
delete docXML;
}
function cargarNoticia(direccion) {
url = direccion;
for (x=0; x<total; x++) {
removeMovieClip("titular"+x);
}
gotoAndStop(2);
}
var url, total;
var docXML = new XML();
docXML.ignoreWhite = true;
docXML.onLoad = cargaXML;
docXML.load("main2.xml");
stop();

En el frame 2 con éste código me carga las noticias de los links:
function cargaXML(){
primerNivel = this.firstChild;
fecha = "FECHA: "+ primerNivel.attributes.publicacion;
segundoNivel = primerNivel.childNodes;
autor = "AUTOR: " + segundoNivel[0].firstChild.nodeValue;
cuerpo = segundoNivel[1].firstChild.nodeValue;
limpiaXML()
}

function limpiaXML(){
delete primerNivel;
delete segundoNivel;
delete docXML;
}

docXML=new XML();
docXML.ignoreWhite = true;
docXML.onLoad = cargaXML;
docXML.load(url);

Gracias.
__________________
Bandit.
Si no sabes estudia y si sabes enseña.
http://www.banditwebdesign.com/