Istruzioni
path= Cartella che contiene le foto
nome foto = prefix_01.jpg.............prefix_10.....
devi avere 2 Clip (200 x 200) sovrapposti
Buon lavoro.
codice:
// Dimensioni FOTO 200 x 200
DimX=200
DimY=200
time = getTimer();
pause = 3000; // es. per 5 secondi (5.000 millisecondi)
fadeout = false;
numvar=1
clip_name = "path/prefix_0"+numvar+".jpg";
loadMovie (clip_name, sfondo1);
loadMovie (clip_name, sfondo2);
preload = function () {
if (sfondo1.getBytesLoaded() == sfondo1.getBytesTotal() && _root.back1.getBytesTotal()>1024) {
clearInterval(preloadID);
} else {
//_root.barra_mc._xscale = _root.back1.getBytesLoaded()/_root.back1.getBytesTotal()*100;
}
};
preloadID = setInterval(preload, 100);
this.onEnterFrame = function() {
if (getTimer() - this.time >= this.pause) {
this.time = getTimer();
this.fadeout = true;
this.numvar = Math.round(Math.random()*12); // * 12 immagini
if (this.numvar<1) {
this.numvar = 1; // per evitare il numero 0
}
if(this.numvar<=9){this.clip_name = "path/prefix_0"+this.numvar+".jpg";}
else{this.clip_name = "path/prefix_"+this.numvar+".jpg";}
loadMovie (clip_name, this.sfondo2);
preload = function () {
//_root.barra_mc._xscale = 0
if (this.sfondo2.getBytesLoaded() == this.sfondo2.getBytesTotal() && _root.back2.getBytesTotal()>1024) {
clearInterval(preloadID);
} else {
//_root.barra_mc._xscale = _root.back2.getBytesLoaded()/_root.back2.getBytesTotal()*100;
}
};
preloadID = setInterval(preload, 100);
}
if (fadeout) {
if (this.sfondo1._alpha > 0) {
this.sfondo1._alpha -= 5;
} else {
this.fadeout = false;
loadMovie (clip_name, this.sfondo1);
}
} else {
this.sfondo1._alpha = 99;
}
}