Ver Mensaje Individual
  #5 (permalink)  
Antiguo 19/03/2009, 06:33
Rubensfh
 
Fecha de Ingreso: abril-2007
Mensajes: 26
Antigüedad: 17 años
Puntos: 0
Exclamación Respuesta: Cargar datos xml en flash as2

Nada ya esta solucionado lo de la imagen solo tenia que quitarle el root a la linea:
_root.pantalla_mc.loadMovie(imagen);
tenia que ser:
pantalla_mc.loadMovie(imagen);

Asi que el tema de la imagen ya esta, ahora solo me queda el ultimo problema que me gustaria poner dos botones al de atras y siguiente pero me gustaria que el los dos botones no salieran a no ser que haya mas de una oferta, explico:
Si hay una oferta que no salga ninguno, si hay dos que solo salga el boton de siguiente y cuando vamos a la segunda oferta que salga el boton de atras y el de siguiente que desaparezca y asi sucesibamente. Pero todo sin tocar las lineas de codigo anteriores.Tengo este codigo pero no se que es lo que faya por que los datos me los carga pero no me carga los botones:

Código:
stop ();
var obj_xml:XML = new XML();
obj_xml.ignoreWhite = true;
but._x=-300;
but1._x=-300;
var num:Number=0;
obj_xml.onLoad = function(exito) 
{
	if (exito) 
	{

	    cargar(0);
	}
 
};
cargar =function(num:Number)
{
		articulo.text = obj_xml.firstChild.childNodes[0].firstChild.nodeValue;
		descripcion.text = obj_xml.firstChild.childNodes[1].firstChild.nodeValue;
		precio.text = obj_xml.firstChild.childNodes[2].firstChild.nodeValue;
		imagen = obj_xml.firstChild.childNodes[3].firstChild.nodeValue;
		pantalla_mc.loadMovie(imagen);
	} 
	obj_xml.load("OFERTAS-WEB.xml");
if(obj_xml.firstChild.childNodes[0].firstChild.childNodes[num+1]==null)
		but1._x=-200;
	else
	    but1._x=100;
    if(num==0)
	   but._x=-200;
	else
	   but._x=250;
Si alguien me puede ayudar se lo agradecesia mucho.
Un saludo a todos¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡

Última edición por Rubensfh; 19/03/2009 a las 07:20