# Bunch of movieclips, one mask...dynamically

**URL:** https://forum.kirupa.com/t/bunch-of-movieclips-one-mask-dynamically/136324
**Category:** Uncategorized
**Created:** [February 3, 2005, 8:02pm UTC](https://forum.kirupa.com/t/bunch-of-movieclips-one-mask-dynamically/136324 "2005-02-03T20:02:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![simonbun](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@simonbun](https://forum.kirupa.com/u/simonbun)
#### Post date: [February 3, 2005, 8:02pm UTC](https://forum.kirupa.com/t/bunch-of-movieclips-one-mask-dynamically/136324/1 "2005-02-03T20:02:32Z")

</div>

Hi everyone…another day, another question 😉

I’m trying to dynamically generate a menu for a site. I have one movieclip that i duplicate and i want all those duplicates to share a mask.

```auto

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

	 _root.menuitem.duplicateMovieClip("menuitem"+i, i);
	 _root["menuitem"+i]._y = menuYpos;
	 menuYpos += 35;

	 _root["menuitem"+i].setMask(myMask);
					
}

```

This causes only the first menuitem to use the mask. After some searching i found that i should combine all these generated movieclips into one container movieclip and ultimately mask that container with myMask.

I tried some createEmptyMovieClip, attachMovie & setMask combo’s but it doesnt seem to work. Does anyone know the proper sollution?

Thanks!
