Question : Creating child movie clips inside a parent movie clip

From what I understand workGallery in my parent movie clip and  projectPieces my child movie clip.
what i would like to do is create lets say four projectPieces movie clips that aline to the right of each other.

I am guessing that each movie clip would have to have it's own name or can they be created using one movie clip and copying it over and over?

I am creating a gallery but going about it step by step.  
Code Snippet:
1:
2:
3:
4:
5:
var workGallery:MovieClip = new MovieClip;
var projectPieces:MovieClip = new MovieClip;
 
addChild(workGallery);
workGallery.addChild(projectPieces);
Open in New Window Select All

Answer : Creating child movie clips inside a parent movie clip

Yep, but in the code above, we're already creating it first, and then adding the children inside it.

-V
1:
2:
3:
4:
5:
6:
7:
8:
9:
var workGallery:MovieClip = new MovieClip();
var xSpace:Number = 70; //pixels
addChild(workGallery); // "container MC" is created
 
for(var i:0;i<=3;i++) {
  var projectPieces:MovieClip = new MovieClip();
  projectPieces.x = i*xSpace;
  workGallery.addChild(projectPieces); children are added to the container MC
}
Open in New Window Select All
Random Solutions  
 
programming4us programming4us