# Help with masking

**URL:** <https://forum.kirupa.com/t/help-with-masking/224446>\
**Category:** Uncategorized\
**Created:** [May 2, 2007, 2:26pm UTC](https://forum.kirupa.com/t/help-with-masking/224446 "2007-05-02T14:26:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![grimboto](https://avatars.discourse-cdn.com/v4/letter/g/9d8465/32.png) [@grimboto](https://forum.kirupa.com/u/grimboto)\
**Post date:** [May 2, 2007, 2:26pm UTC](https://forum.kirupa.com/t/help-with-masking/224446/1 "2007-05-02T14:26:02Z")

</div>

hey  
so I’m trying to make dynamic mask that gets bigger by drawing lines to uncover a tree.(as if it is growing).

i’ve written the code to make the movieclip grow to the shape of the tree but when i set it to mask the movieclip that contains the tree every thing just disappears.

```auto

var number_of_dots = 9;
var treeArray = new Array(number_of_dots);
var branch = 1;
_root.createEmptyMovieClip("maskLine",0);

for (k=1; k<treeArray.length; k++) {
    treeArray[k] = _root["d"+k];
}

_root.onEnterFrame = function() {
    if (branch<treeArray.length-1) {
        maskLine.moveTo(treeArray[branch]._x,treeArray[branch]._y);
        maskLine.lineStyle(15,0x000000,100);
        maskLine.lineTo(treeArray[branch+1]._x,treeArray[branch+1]._y);
        branch++;
    }
    _root.maskee.setMask(_root.maskLine);  
};

```

where [“d”+k] are movieclips on the stage so x,y coods can be found and maskee is the movieclip of the tree.

any help would be much appreciated.

thanks in advance grimboto
