Dynamic Masking MovieClips

I have a movieclip in which i create an empty mc and inside there i attach several other mcs in a loop (to create a menu of button movieclips inside the empty one) then I want to create a mask and mask the menu so you only see certain options at a time. So far I have this:


function createMenu([color=Red]menuIn,....other *params*...[/color]) {

	menuIn.createEmptyMovieClip("menu",1)

	for (i=0; i < menusize; i++){
[color=Black] menuIn.menu.attachMovie(libitem,"menuItem"+buttonCount, buttonCount);[/color]
[color=Red]*[.....code to create buttons from xml info here.... ]*[/color]
	}
	setMenuMask(menuIn,"dynMenuMask");
}

function setMenuMask(menuIn,maskLibItemIn){
	menuIn.createEmptyMovieClip("menuMaskClip",2);
	menuIn.menuMaskClip.attachMovie(maskLibItemIn,"maskArea",1);
	menuIn.menu.setMask(menuIn.menuMaskClip);
}

However the menu (list of mcs dynamically created from library) is not masked, it is created and works but when i run that setMask it doesnt work… is it something to do with depths??

The code I have ommited works, it is just using info from xml to create the list of items. But the list definately gets created and is visible. if i dont use setMask you can see the mask movieclip in position when you use setmask you cant see the mask anymore because its been set to be a mask… but the menu ISN’T being masked by it.

Any Ideas???