I'm trying to figure out an easy way to fade 4 (or any number) images and loop it so the last image fades in with the first image. I threw something together which is pretty horrible, and doesn't even fade the last image into the first. The code is included below for you to laugh at.
Any idea how I could improve this?
function beginTween():void
{
TweenMax.to(bg01, 2, { alpha:1 });
TweenMax.to(bg01, 2, { alpha:0, delay:20 });
TweenMax.to(bg02, 2, { alpha:1, delay:20 });
TweenMax.to(bg02, 2, { alpha:0, delay:25 });
TweenMax.to(bg03, 2, { alpha:1, delay:25 });
TweenMax.to(bg03, 2, { alpha:0, delay:30 });
TweenMax.to(bg04, 2, { alpha:1, delay:30 });
TweenMax.to(bg04, 2, { alpha:0, delay:35 });
TweenMax.to(bg05, 2, { alpha:1, delay:35 });
TweenMax.to(bg05, 0.5, { alpha:0, delay:40, onComplete:beginTween });
}
beginTween();