Dynamically adding actionscript to a _mc

I have been able to make as many MC instances as i want using the attachMovie() funciton. e.g.

for (x=1; x<=10; x++){
_root.attachMovie(“box_mc”,“box”+x+"_mc",x);
}

Now lets say i have some actionscript (same code) that i want to add to each instance of that mc … how would i go about doing that without having to actually make each instance manually and add the code?

Any help would be greatly appreciated

thanks