[Flash 8] .attachMovie method

i have a blue mc that plays the role of a button and a black square(also a mc) next to it. when i press the blue, one of the 3 pentagonal mc that are in the library(and exported for actionscript) should load randomly in the black square. unfortunately this isn’t working. both of the traces return the value that they should but i can’t use those values to specify the .attachMobie parameters. why is this not working?

button.onPress = function() {
	var number = Math.floor(Math.random()*3);
	grid = new Array("yellow","red","green");
	var adding = square.attachMovie("grid[number]","number","number");
	trace(number);
	trace(grid[number]);
	}