# Duplicating child clips

**URL:** https://forum.kirupa.com/t/duplicating-child-clips/127733
**Category:** Uncategorized
**Created:** [November 5, 2004, 3:34pm UTC](https://forum.kirupa.com/t/duplicating-child-clips/127733 "2004-11-05T15:34:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dougt](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@dougt](https://forum.kirupa.com/u/dougt)
#### Post date: [November 5, 2004, 3:34pm UTC](https://forum.kirupa.com/t/duplicating-child-clips/127733/1 "2004-11-05T15:34:24Z")

</div>

Please, please help!!

I’m trying to duplicate a movie clip that has several child clips, after I’ve rotated the child clips. My code:

ctrX = Stage.width/2;  
ctrY = Stage.height/2;

button.onRelease = function() {  
box.s1.\_rotation -= 45;   
box.s2.\_rotation -= 45;   
box.s3.\_rotation -= 45;

for (var i=1; i\< 9; i++) {  
var depth = (i-1)\*4;  
var rot = (i-1) \* 45;   
var dbox:MovieClip = box.duplicateMovieClip(“box”+i,depth+1,{\_x:ctrX, \_y:ctrY, \_rotation:rot});  
var dmask:MovieClip = mask.duplicateMovieClip(“mask”+i,depth+2,{\_x:ctrX, \_y:ctrY, \_rotation:rot});  
dbox.setMask(dmask);  
}  
}

The clips “box” and “mask” are in a single frame on the stage, as is button, and the clips s1,s2 and s3 are in a single frame in “box.” There’s no other code anywhere.

What I want to do is duplicate “box” after mainpulating its child clips. What I get is a duplicate of the original “box” each time I press the button. Can someone help?

BTW, the above stuff is a prototype, strictly to try to figure what in the hay is going on. My goal, eventually, is to populate the “box” with dynamic content, then duplicate it multple times.

Thanks,  
dougt
