[Kirupa Tut] Fading Grid with setInterval

Hi everyone :slight_smile:

I’ve made an interval that switch 3 photos i have in 3 different layers, changing their depth with the swapDepths method.

here’s the code :



// SETTO L'INTERVAL

stop();
var intervalId;
var count = 1;
var profonfita = 1;
var maxCount= 3;
var duration= 5000;

function Intervallo() {
 trace("Intervallo intervalId: " + intervalId + " count: " + count);
  this["foto_mc"+count].swapDepths(profondita)
 if(count == maxCount) {
	count=0;
 } 
 count++;
 profondita++;
}

intervalId = setInterval(this, "Intervallo", duration);


Everything works well so i’ve tried to improve this with the Fading Grid tutorial that i’ve found here in Kirupa :

http://www.kirupa.com/developer/mx/fadegrid.htm

I’d like to have the fading grid effect everytime that one of my pic swaps to the layer above. (so an automated fotogallery with that effect everytime a photo comes on the stage).

I’ve tried to put this function :


fadeOut(0, 5);

inside my interval, but it works once, only on the 1st photo.

Does anyone knows how to implement this?

Thx a lot guys, Kirupa rocks!