# duplicateMovieClip()

**URL:** <https://forum.kirupa.com/t/duplicatemovieclip/132027>\
**Category:** Uncategorized\
**Created:** [December 22, 2004, 10:31am UTC](https://forum.kirupa.com/t/duplicatemovieclip/132027 "2004-12-22T10:31:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jazzman121](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jazzman121/32/127_2.png) [@jazzman121](https://forum.kirupa.com/u/jazzman121)\
**Post date:** [December 22, 2004, 10:31am UTC](https://forum.kirupa.com/t/duplicatemovieclip/132027/1 "2004-12-22T10:31:52Z")

</div>

Im trying to repeat a movieclip across y axis… soo it takes Stage.height and divdes the height of movieclip and finds out how many times to duplicate movieclip soo it covers entier swf. Stage… here is my code … but its not working please. help ☹

here instance [COLOR=Red]back[/COLOR] is the movieclip to be repeated along y axis… and [COLOR=DarkRed]back\_repeat[/COLOR] is the variable that contains value of how many times the [COLOR=Red]back[/COLOR] movieclip should be repeated

```auto

back_repeat = Stage.height/back._height;
back_repeat = Math.round(back_repeat);
i=0;
while(i<back_repeat) {
	back.duplicateMovieClip("back"+i,i);
	_root["back"+i]._y = _root["back"+i]._y + back._height;
	i++;
}

```
