# Dynamic mask

**URL:** <https://forum.kirupa.com/t/dynamic-mask/158320>\
**Category:** Uncategorized\
**Created:** [August 9, 2005, 1:19am UTC](https://forum.kirupa.com/t/dynamic-mask/158320 "2005-08-09T01:19:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wdv](https://avatars.discourse-cdn.com/v4/letter/w/9fc29f/32.png) [@wdv](https://forum.kirupa.com/u/wdv)\
**Post date:** [August 9, 2005, 1:19am UTC](https://forum.kirupa.com/t/dynamic-mask/158320/1 "2005-08-09T01:19:14Z")

</div>

hello I have a dynamic mask action code written below, can anyone help me edit this code so that it only reveals images on mouse press. Right now it automatically reveals images on mouse over.

onClipEvent(load)  
{  
\_root.createEmptyMovieClip(‘square’,0);  
function drawSquare()  
{  
x = \_root.\_xmouse;  
y = \_root.\_ymouse;  
with(\_root.square)  
{

```
                    moveTo(x-10,y-10);
                    beginFill(0x000088)
                    lineTo(x+10,y-10);
                    lineTo(x+10,y+10);
                    lineTo(x-10,y+10);
                    endFill();
            }
    }
    this.setMask (_root.square)

```

}  
onClipEvent(mouseMove)  
{  
drawSquare();  
updateAfterEvent();  
}
