# Masking multiple attached movieclip

**URL:** <https://forum.kirupa.com/t/masking-multiple-attached-movieclip/322708>\
**Category:** Uncategorized\
**Created:** [May 31, 2011, 12:29pm UTC](https://forum.kirupa.com/t/masking-multiple-attached-movieclip/322708 "2011-05-31T12:29:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sathyapriyamani](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@sathyapriyamani](https://forum.kirupa.com/u/sathyapriyamani)\
**Post date:** [May 31, 2011, 12:29pm UTC](https://forum.kirupa.com/t/masking-multiple-attached-movieclip/322708/1 "2011-05-31T12:29:19Z")

</div>

hai all,

i am using Flash MX2004(AS 2.0), i need to mask the attached movieclip,  
totally i attached 3 movieclip(all are same one), i need to display first movieclip by using mask. one more thing is moving that mask by press button, when i press the button the mask will show the second movie clip and so on…can any one help me…

this is my code:i have to mask box1\_mc

function cardcolor() {  
var color:Color = new Color(\_root[“box\_mc1”+i].box1\_mc);  
var t:Number = 0x00FF00;  
\_root[“box\_mc1”+i].onPress = function():Void {  
if (t == 0x00FF00) {  
color.setRGB(0x0000FF);  
} else if (t == 0x0000FF) {  
color.setRGB(0x00FF00);  
}  
color.getRGB();  
t = color.getRGB();  
};  
}  
var x1 = 100;  
for (var i = 1; i\<=3; i++) {  
\_root.attachMovie(“box\_mc”,“box\_mc1”+i,i);  
cardcolor();  
\_root[“box\_mc1”+i].setMask(mask\_mc);  
\_root[“box\_mc1”+i].\_x = x1;  
\_root[“box\_mc1”+i].\_y = 100;  
x1 += 200;  
}

thanks…  
sakthimani(-:
