Ciao a tutti...avevo bisogno di creare una galleria di foto random. Ho trovato un file flash girando in rete che funziona molto bene ma vorrei modificare se possibile il fade. In pratica con questo file le immagine vengono caricate in maniera casuale ma tra un immagine e l'altra c'è un vuoto che vorrei evitare. Mi spiego meglio: il filmato carica la prima immagine partendo da un livello alpha 0 la mantiene per 2/3 secondi ad un livello alpha 100, poi c'è il fade out che porta il livello alpha a 0 e carica la seconda immagine con lo stesso sistema. In pratica tra un immagine e l'altra si creano dei frame vuoti. Io vorrei ottenere un fade che "miscela" le due immagini con continuità, eliminando cosi il vuoto. E' possibile secondo voi modificando i seguenti parametri:

//: SETUP VARIABLES
var maxVal = 7; // max number of fotos
var oldVar = 0; // keep track of previous random number
var newVar = 0; // used to load the next image
var si = 0; // interval variable

//: LOAD THE NEXT IAMGE
function getImage() {
newVar = Math.floor(Math.random() * maxVal); // get random number
if (newVar == oldVar) { // if number = old number..
getImage(); // get a number
} else { // else
oldVar = newVar; // set old to new number
container_mc.loadMovie ("fotos/foto" + newVar + ".jpg"); // load the next image
container_mc._alpha = 0; // set its alpha to 0
this.onEnterFrame = function () { // create loop
if (container_mc._width > 0) { // check that the image has been loaded
container_mc._x = Stage.width / 2 - container_mc._width / 2; // center movieclip to stage
container_mc.onEnterFrame = fadeIn; // start fading out
delete this.onEnterFrame; // delete loop
}
}
}
}

//: FADE IN THE CURRENT MOVIECLIP
function fadeIn () {
if (this._alpha <= 100) { // if the movieclips alpha is greater than 0
this._alpha += 5; // reduce alpha by 5
} else { // else
this._alpha = 100; // reduce alpha to 0
delete this.onEnterFrame; // delete handler
si = setInterval(fadeOut, 3500); // after 2 seconds, fade out the movieclip
}
}

//: FADE OUT THE CURRENT MOVIECLIP
function fadeOut () {
clearInterval(si); // clear the interval variable
container_mc.onEnterFrame = function() { // create loop to fade out
if (this._alpha >= 0) { // if the movieclips alpha is greater than 0
this._alpha -= 5; // reduce alpha by 5
} else { // else
this._alpha = 0; // reduce alpha to 0
delete this.onEnterFrame; // delete handler
getImage(); // load the next image
}
}
}

// load first image
getImage();