Help with attachMovieClip

i know how to attach a Movie Clip in one line i did this code
for(i=0; i<10; i++) {
_root.attachMovie(“ball”,“ball”+i, i);
_root[“ball”+i]._x=i*_root[“ball”+i]._width;
}
so this clip will generate 10 MovieClip in one line

the one i really want to do is i want 10 lines
and each line that will make 10 Movie Clip
how can i achieve this??

for(i=0; i<10; i++) {

for(j=0; j<10; j++) {
d = _root.depth++;
_root.attachMovie(“ball”,“ball”+d, d);
_root[“ball”+d]._x=i*_root[“ball”+d]._width;
}

}

and if you want it to be gridlike (the new 10 going down too) use
for(i=0; i<10; i++) {

for(j=0; j<10; j++) {
d = _root.depth++;
_root.attachMovie(“ball”,“ball”+d, d);
_root[“ball”+d]._x=i*_root[“ball”+d]._width;
_root[“ball”+d]._y=j*_root[“ball”+d]._height;
}

}

hey thanks exactly what i want to do
but can you explain your code cuz dont really understand
im new to AS i dont want just to apply it i want to understand it too