Foros del Web » Creando para Internet » Flash y Actionscript »

Cargar noticia xml

Estas en el tema de Cargar noticia xml en el foro de Flash y Actionscript en Foros del Web. Esoy empezando con esto de Actionscript, y tengo un problema. Tengo una plantilla para publicar noticias con una botonera "menú", que carga un xml que ...
  #1 (permalink)  
Antiguo 15/09/2011, 12:48
 
Fecha de Ingreso: septiembre-2011
Mensajes: 1
Antigüedad: 12 años, 7 meses
Puntos: 0
Cargar noticia xml

Esoy empezando con esto de Actionscript, y tengo un problema.
Tengo una plantilla para publicar noticias con una botonera "menú", que carga un xml que contiene los textos....

El caso es que no consigo que cuando se carga el clip de película, cargue directamente la primera noticia del xml, y tengo que pulsar en el primer boton para que aparezca.

ALmas solidarias, ayudarme, gracias.

Cita:
var news: Number = 0;
var separacion: Number = 5;
var ancho_Escenario: Number = 600;

_root.createEmptyMovieClip("foto", 10);
foto._x=342.4;
foto._y=182.0;

var agenda_noticias: XML = new XML();
agenda_noticias.ignoreWhite = true;


function parsea (exito: Boolean){
if (exito){
_root.createEmptyMovieClip("menu", 11);
menu._visible = true;

nombre.htmlText = "<p align=\"center\"><b>" + this.firstChild.nodeName.toUpperCase() + "</b>: Seleccione el número de noticia</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(){
fechacabeza.htmlText = "<p align=\"left\"><b>" + this.fecha + "</p>";
cabecera.htmlText = "<p align=\"left\"><b>" + this.cabecera + "</p>";
if (this.url != "no"){
foto.loadMovie(this.url);
} else {
foto.loadMovie("fotografias/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("textos/" + this.id + ".txt")
}

news++;
}
}
menu._x = (ancho_Escenario / 2) - (menu._width / 2);
menu._y = 10;
menu._visible = true;
} else {
nombre.htmlText = "<p align=\"center\"><b>Error al cargar los datos</b></p>";
}
}

agenda_noticias.onLoad = parsea;
agenda_noticias.load("noticias.xml");
  #2 (permalink)  
Antiguo 04/10/2011, 20:17
Avatar de Andreys123456  
Fecha de Ingreso: febrero-2009
Ubicación: Perez Zeledon
Mensajes: 148
Antigüedad: 15 años, 2 meses
Puntos: 0
Respuesta: Cargar noticia xml

Intenta con este .

http://www.cristalab.com/tutoriales/...magenes-c186l/

al final de la pagina lo puedes descargar !

Etiquetas: actionscript, noticia, xml, botones, clips
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:24.