# Mask Move with mouse

**URL:** <https://forum.kirupa.com/t/mask-move-with-mouse/308739>\
**Category:** flash\
**Created:** [April 29, 2010, 5:39am UTC](https://forum.kirupa.com/t/mask-move-with-mouse/308739 "2010-04-29T05:39:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![experts585](https://avatars.discourse-cdn.com/v4/letter/e/ecae2f/32.png) [@experts585](https://forum.kirupa.com/u/experts585)\
**Post date:** [April 29, 2010, 5:39am UTC](https://forum.kirupa.com/t/mask-move-with-mouse/308739/1 "2010-04-29T05:39:14Z")

</div>

i have a problem in moving the mask with mouse  
someone tel me

what is the right code

here is the code i use

// myImage is bakground image  
// myMask is masking  
stop();  
myImage.setMask(myMask);  
onEnterFrame= function(myMask) {  
\_root.\_xmouse - this.\_x ;  
\_root.\_ymouse - this.\_y ;  
\_x += myMask ;  
\_y += myMask ;  
}

[//myMask.onPress](https://myMask.onPress) = function() {  
//startDrag(this);  
//}  
[//myMask.onRelease](https://myMask.onRelease) = function() {  
//stopDrag();  
//}
