Simple Animated Gif Style Image Fader in Actionscript!

Hi there,

This may seem veru basic but i am new to this!

I am aiming to create a looping array of images so that each fades in and fades out again … here is the code i have so far … it works EXCEPT … it stops at the end of the array and appears to jump or hop a little between images … want it to be smoother.

Can anyone help me? I am in need of a helping hand!

 
var aImages:Array = new Array("flashcontent.png", "flashcontent2.png", "flashcontent3.png");[/quote][quote]
var imageFolder = "../images/";
var fadeRate:Number = 1;
var imageCounter:Number = 0;
 
 
function imageFade (selectedImage) {
 
onEnterFrame = function()
{
selectedImage._alpha += fadeRate;
if (selectedImage._alpha > 100 )
{
fadeRate *= -1;
}
if (selectedImage._alpha < 6)
{
imageCounter++;
if (imageCounter>aImages.length-1)
{
onEnterFrame = null;
selectedImage._alpha = 0;
break;
}
else
{
mcContainer.loadMovie(imageFolder+aImages[imageCounter]); 
fadeRate *=-1;
}
}
}
 
}
 
mcContainer._alpha = 12;
mcContainer.loadMovie(imageFolder+aImages[0]);
imageFade(mcContainer);