Salve a tutti,
ho messo su un bottone questo AS per caricare dinamicamente in un mc delle foto da una cartella:
on (release) {
Stage.scaleMode = false;
largh = Stage.width;
altez = Stage.height;
fscommand("allowscale", false);
function loading() {
car = mc.getBytesLoaded();
tot = mc.getBytesTotal();
if (car>1024) {
if (car == tot) {
mc._x = Math.round((largh-mc._width)/2+255);
mc._y = Math.round((altez-mc._height)/2-41);
mc._alpha = 100;
clearInterval(a);
}
}
}
loadVariablesNum("gallery.txt", 0);
function cambiafoto() {
if (i>=file) {
i = 1;
} else {
i++;
}
mc._alpha = 0;
mc.loadMovie("fotos/"+i+".jpg");
setProperty(mc, _xscale, 80);
setProperty(mc, _yscale, 80);
clearInterval(b);
a = setInterval(loading, 100);
}
i ++;
mc._alpha = 0;
_root.mc.loadMovie("fotos/"+i+".jpg");
setProperty(mc, _xscale, 80);
setProperty(mc, _yscale, 80);
a = setInterval(loading, 100);
}
e nel medesimo frame di un livello superiore l' azione:
loadMovie("fotos/1.jpg", mc);
setProperty(mc, _xscale, 80);
setProperty(mc, _yscale, 80);
così che quando si arriva su questo frame appaia la foto .jpg e lo slide cominci da quella.
Il problema è che in realtà quando finiscono le foto, e quindi i>=file non legge
i=1 e finisce lo slide, cioè non carica di nuovo l'immagine 1.jpg. Perchè???
Sto annegando in un bicchier d'acqua?? :dot

Rispondi quotando
