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) {;
	var amount = 6; = 50; = 100; =;
	//duplicate 6 times
	for (var i = 0; i<amount; i++) {"ball"+i, i);
		//set the original invisible = 0;["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(["ball"+i].screen);
	component._visible = false;