Bunch of movieclips, one mask...dynamically

Hi everyone…another day, another question :wink:

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.


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!