# Mask / Movement problems

**URL:** https://forum.kirupa.com/t/mask-movement-problems/157795
**Category:** flash
**Created:** [August 4, 2005, 11:05am UTC](https://forum.kirupa.com/t/mask-movement-problems/157795 "2005-08-04T11:05:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Vexir](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@Vexir](https://forum.kirupa.com/u/Vexir)
#### Post date: [August 4, 2005, 11:05am UTC](https://forum.kirupa.com/t/mask-movement-problems/157795/1 "2005-08-04T11:05:22Z")

</div>

Hey guys, I have a little movie clip on my stage which is a semi transparent square pretty much, and on the same \_y I have a movieclip which contains all the buttons for my nav bar. I tried to put some AS on the little box (we’ll call it greysq\_mc) and have it mask the button’s mc (we’ll call it navbuttons\_mc) as well as move down to the \_x of the HOME button (homebutton). Check out my code, its not working for me.

Thanks in advance! :thumb:

[AS]onClipEvent (load) {  
navbuttons\_mc.setMask( greysq\_mc );  
}

onClipEvent (enterFrame) {  
if ( this.\_x \> navbuttons\_mc.homebutton.\_x ) {  
// reduce \_x value because this is to the right of the target!  
–this.\_x  
}  
else {  
navbuttons\_mc.setMask(null);  
delete this.onEnterFrame;  
}  
}[/AS]
