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.

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