# Mask problem

**URL:** <https://forum.kirupa.com/t/mask-problem/169958>\
**Category:** Uncategorized\
**Created:** [November 21, 2005, 4:35pm UTC](https://forum.kirupa.com/t/mask-problem/169958 "2005-11-21T16:35:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![HITMANukas](https://avatars.discourse-cdn.com/v4/letter/h/c57346/32.png) [@HITMANukas](https://forum.kirupa.com/u/HITMANukas)\
**Post date:** [November 21, 2005, 4:35pm UTC](https://forum.kirupa.com/t/mask-problem/169958/1 "2005-11-21T16:35:19Z")

</div>

Hello. I have a problem with a mask. I create an empty movie clip which will be my mask. Then I create a drawing API which is in this emty movie clip. And I want that the lines which are drawn would be the mask of the specific movie clip. However, the mc which must be masked dissapears…It happens because flash still thinks that the mask mc is empty…

The script on the stage(from [kirupa.com](http://kirupa.com)):

\_root.createEmptyMovieClip(“line”, 1);  
// 2. EVENTS IN \_ROOT:  
\_root.onMouseDown = function() {  
\_root.line.moveTo(\_xmouse, \_ymouse);  
\_root.line.lineStyle(30, 0x000000, 100);  
this.onMouseMove = function() {  
\_root.line.lineTo(\_xmouse, \_ymouse);  
updateAfterEvent();  
};  
};  
\_root.onMouseUp = function() {  
this.onMouseMove = null;  
};

The script of the mc which must be masked:

onClipEvent (enterFrame) {  
\_root.square.setMask(\_root.line);  
}

Any help? Thanks.
