It's not been working out

Well, I’m trying to create a for statement that will take images from my library and place them on stage with individual identities. I’m trying to get by creating lots of mcs. Below is my latest attempt; it doesn’t do the job and ends up being quite the memory hog.
–mainImage* is the linkage names of my library images.

for(i=0; i<=_root.mainImage*; i++){
_root.smallImage.attachMovie(“mainImage”, “smallImage”, 3);
_root.smallImage*._x = (i125);
._y = 0;