Random banner with fade out mask

I am going out of my mind… I am trying to recreate this effect so i can modify it towards my design… the website that best illustrates the banner effect that I am trying to achieve is www.dnastudio.com. I have created the mask that fades the front image out, but i have no clue how to loop the MC so that the random image will fade out. If anyone knows how to do this, please help me. I am working with flash 5. The script that i am using for the random image is:

onClipEvent (load) {
this.gotoAndStop(Math.ceil(Math.random()*this._totalframes));
}

I have a MC with all of my images in it. Also, I have a MC called banner that contains the moving bars and fade out mask in it… the problem i am having is looping the random MC. Can someone please help…

lost in flash

norm1252003

Try something like this:

onClipEvent (load) {
	var change = 5000;
	var start = getTimer();
	gotoAndStop(Math.floor(Math.random()*_totalframes)+1);
}
onClipEvent (enterFrame) {
	if (getTimer()-start>=change) {
		var frame = _currentframe;
		while (frame == _currentframe) {
			gotoAndStop(Math.floor(Math.random()*_totalframes)+1);
		}
		start = getTimer();
	}
}

The value of the variable change is the amount (in milliseconds) of time to wait before sending the playhead to a new frame. :slight_smile:

Thanks for responding. where do I put the above script. Is this for the looping of the movie clip or for the random load. do I put it in the main timeline or in the mc that contains the mask fade out and mc of random images. I already have the random load, I cannot get it to loop. Please help, I am a beginner flasher. i am learning slowly. thanks

Put it on the actions of the movie clip that contains the images.