Tengo un código que acabo de encontrar que me valdría para lo que quiero hacer, sólo que me falta poder añadirle links las imágenes para poder hacer zoom sobre ellas.
El código:
System.useCodepage = true;
//
function inicializar() {
id = 0;
carga_fotos();
}
//
mi_xml = new XML();
mi_xml.ignoreWhite = true;
mi_xml.onLoad = function(ok) {
if (ok) {
miarray_array = this.firstChild.childNodes;
tope = miarray_array.length-1;
inicializar();
trace(tope);
} else {
//error
}
};
mi_xml.load("fotos/fotos.xml");
//////////////////////
escuchador = new Object();
escuchador.onLoadInit = tamano;
escuchador.onLoadStart = cargador;
escuchador.onLoadProgress = progreso;
mcLoader = new MovieClipLoader();
mcLoader.addListener(escuchador);
////////////////////
function carga_fotos() {
temporal = miarray_array[id].attributes;
mcLoader.loadClip("fotos/"+temporal.nombre, cuadro_mc);
texto_txt.text = temporal.descripcion;
if (id == 0) {
anterior_btn.enabled = false;
} else {
anterior_btn.enabled = true;
}
if (id == tope) {
siguiente_btn.enabled = false;
} else {
siguiente_btn.enabled = true;
}
}
siguiente_btn.onRelease = function() {
id++;
carga_fotos();
};
anterior_btn.onRelease = function() {
id--;
carga_fotos();
};
function tamano() {
trace(mcLoader._width);
cuadro_mc._xscale = 50;
cuadro_mc._yscale = 50;
mover(cuadro_mc, "_alpha", 0, 100, 7);
marco_mc._width = cuadro_mc._width+25;
marco_mc._height = cuadro_mc._height+25;
}
import mx.transitions.Tween;
function mover(peli, propiedad, posInicial, posFinal, tiempo) {
var myTween:Tween = new Tween(peli, propiedad, mx.transitions.easing.Elastic.easeOut, posInicial, posFinal, tiempo, true);
}
function progreso() {
porcentaje = Math.floor(cuadro_mc.getBytesLoaded()*100/cuadro_mc.getBytesTotal());
trace(porcentaje);
cargador_mc.gotoAndStop(porcentaje);
cargador_mc.cargador_txt.text = porcentaje+"%";
if (porcentaje>=100) {
cargador_mc._visible = false;
} else {
cargador_mc._visible = true;
}
}
Gracias.
