Targeting duplicates II

I attached a movie that I am working on. I use the duplicate actionscript to put several buttons on the stage when clicked. I then want to be able to use the color picker to change the background behind the buttons. As of right now it only works on 1 button and by changing the 6 in this code

for (i=1; i<6; i++)

to 5, 4, 3, 2 or 1 it will only change that button. How can I get them all to change at once?

For your tab button:

on (release) {
	_root.bb.gotoAndStop(4);
	var amount = 6;
	_root.bb._x = 50;
	_root.bb._y = 100;
	_root.bb._xscale = _root.bb._yscale=90;
	//duplicate 6 times
	for (var i = 0; i<amount; i++) {
		_root.bb.t1.duplicateMovieClip("ball"+i, i);
		//set the original invisible
		_root.bb.t1._visible = 0;
		_root.bb["ball"+i]._x = 101*i;
	}
}

and in the as layer of the panel buttons mc:

colorBtn.onPress = function() {
	colorBox._visible = !colorBox._visible;
};
colorBtn.useHandCursor = false;
function myHandler(component) {
	for (i=0; i<6; i++) {
		myColor = new Color(_root.bb["ball"+i].screen);
		myColor.setRGB(component.getRgbValue());
	}
	component._visible = false;
}
colorBox.setChangeHandler("myHandler");

scotty(-: