Ver Mensaje Individual
  #9 (permalink)  
Antiguo 21/09/2006, 11:33
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
Hola ciberpato:
Este es el código:
var news:Number=0;
var separacion:Number=10;
var ancho_Escenario:Number=550;
var news:Number = 0;
var separacion:Number = 10;
var ancho_Escenario:Number = 550;
_root.createEmptyMovieClip("foto", 10);
foto._x = 226;
foto._y = 114;
var agenda_noticias:XML = new XML();
agenda_noticias.ignoreWhite = true;
function parsea(exito:Boolean) {
if (exito) {
_root.createEmptyMovieClip("menu", 11);
menu._visible = false;
nombre.htmlText = "<p align=\"center\"><b>"+this.firstChild.nodeName.toU pperCase()+"</b>: Elija las noticias en el menú inferior de la pantalla</p>";
for (var i = 0; i<this.firstChild.childNodes.length; i++) {
for (var j = 0; j<this.firstChild.childNodes[i].childNodes.length; j++) {
menu.attachMovie("nueva_noticia", "boton"+news, news);
menu["boton"+news].numero.text = news+1;
menu["boton"+news]._x = news*(menu["boton"+news]._width+separacion);
menu["boton"+news].id = this.firstChild.childNodes[i].childNodes[j].attributes.id;
menu["boton"+news].cabecera = this.firstChild.childNodes[i].childNodes[j].attributes.cabecera;
menu["boton"+news].url = this.firstChild.childNodes[i].childNodes[j].attributes.url;
menu["boton"+news].fecha = this.firstChild.childNodes[i].attributes.dia;
menu["boton"+news].onRelease = function() {
cabecera.htmlText = "<p align=\"left\"><b>"+this.fecha+".-</b> "+this.cabecera+"</p>";
if (this.url != "no") {
foto.loadMovie(this.url);
} else {
foto.loadMovie("no.jpg");
}
var cargador:LoadVars = new LoadVars();
cargador.onLoad = function(exito:Boolean) {
if (exito) {
cuerpo.text = cargador.texto;
} else {
cuerpo.text = "No se pudo cargar el texto de esta noticia";
}
delete cargador;
};
cargador.load(+this.id+".txt");
};
news++;
}
}
menu._x = (ancho_Escenario/2)-(menu._width/2);
menu._y = 350;
menu._visible = true;
} else {
nombre.htmlText = "<p align=\"center\"><b>Error al cargar los datos</b></p>";
}
}
agenda_noticias.onLoad = parsea;
agenda_noticias.load("datos.xml");

Espero haberte sido de ayuda.
__________________
Bandit.
Si no sabes estudia y si sabes enseña.
http://www.banditwebdesign.com/