Si alguién me puede dar una mano lo agradeceré.
Este es el codigo q utilizo:
Código :
var loaded:Number;
var vieneva:Number=0;
var loader:URLLoader = new URLLoader();
var mov1 = new Loader();
var XmlExterno:XML;
var i:Number=0;
var lista:XMLList;
var total:Number;
loader.load(new URLRequest("Galeria.xml"));
loader.addEventListener(Event.COMPLETE, cargar_foto);
function cargar_foto(event:Event):void
{
XmlExterno = new XML(loader.data);
lista=XmlExterno.children();
total=lista.length();
mov1.load(new URLRequest(lista[i].attribute("imagen")));
mov1.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, foto_progreso);
mov1.contentLoaderInfo.addEventListener(Event.COMPLETE, foto_cargada);
}
function foto_progreso(e:ProgressEvent):void
{
var porcentaje:Number = Math.round(e.bytesLoaded / e.bytesTotal * 100);
loading_info.text = "Loading... " + porcentaje + "%";
}
function foto_cargada(e:Event):void
{
loading_info.text = "";
contenedorImagenes.addChild( Bitmap(e.target.content) );
TransitionManager.start(contenedorImagenes, {type:PixelDissolve, direction:Transition.IN, duration:2, easing:Regular.easeIn, xSections:50, ySections:50});
descripcion.text=lista[i].attribute("descripcion");
vieneva=1;
}
var intervalo:Timer = new Timer(4000, 100);
intervalo.addEventListener(TimerEvent.TIMER, tiempo);
intervalo.start();
function tiempo(event:TimerEvent):void {
if (vieneva==0) {
if (i<total-1) {
i++;
}
this.cargar_foto(event);
intervalo.delay=4000;
TransitionManager.start(contenedorImagenes, {type:PixelDissolve, direction:Transition.IN, duration:2, easing:Regular.easeIn, xSections:50, ySections:50});
vieneva=1;
if (i==(total-1)) {
i=-1;
}
} else {
intervalo.delay=1000;
TransitionManager.start(contenedorImagenes, {type:PixelDissolve, direction:Transition.OUT, duration:1, easing:Regular.easeOut, xSections:50, ySections:50});
vieneva=0;
}
}
Muchas gracias a todos
Diego
