How to simplify and improve my code?

Hello,
Been reading up on the flash transition object.

I came up with this way of fading out one clip and fading in another and having them loop forever using the transition objects but it’s very dirty coding and not very flexible.

Is there a way to clean it up so that I can add as many clips as I want without having to write more code, just by adding more movie clips to the stage?

Thanks


// initialize all the clips to 0 alpha
function fullalpha() {
	var i;
	for(i in _root) {
		if (this* instanceof MovieClip);
		this*._alpha = 0;
	}
}
fullalpha();



import mx.transitions.Tween;
import mx.transitions.easing.*;

//fade out the first object
function playFades() {
	var tween_handler1:Object = new Tween(content1, "_alpha", Strong.easeIn, 100, 0, 3.5, true);
	tween_handler1.onMotionFinished = function() {
		//fade in second object
	   var tween_handler1:Object = new Tween(content2, "_alpha", Strong.easeIn, 0, 100, 1, true);
	   tween_handler1.onMotionFinished = function() {
		   //fade out the second object
		   var tween_handler1:Object = new Tween(content2, "_alpha", Strong.easeIn, 100, 0, 3.5, true);
		   tween_handler1.onMotionFinished = function() {
			   //fade in the first object
			   var tween_handler1:Object = new Tween(content1, "_alpha", Strong.easeIn, 0, 100, 1, true);
			   tween_handler1.onMotionFinished = function() {
                                   //loop back to the beginning again
				   playFades();
			   }
		   }
	   }
	}
}
playFades();