# Dynamicly Drawn Mask Problemo

**URL:** <https://forum.kirupa.com/t/dynamicly-drawn-mask-problemo/222438>\
**Category:** flash\
**Created:** [April 13, 2007, 2:29pm UTC](https://forum.kirupa.com/t/dynamicly-drawn-mask-problemo/222438 "2007-04-13T14:29:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yakka](https://avatars.discourse-cdn.com/v4/letter/y/a9a28c/32.png) [@yakka](https://forum.kirupa.com/u/yakka)\
**Post date:** [April 13, 2007, 2:29pm UTC](https://forum.kirupa.com/t/dynamicly-drawn-mask-problemo/222438/1 "2007-04-13T14:29:46Z")

</div>

Hello peoples…

I have this dynamicaly drawn mask, works in flash player 6 with .as1 and .as2 but can’t get it to work in player 7 and above

```auto
//green mask
//Global vars
mWidth = 516;
//Create movie clip and mask
counter = -1;
createMovieClip();
animInt = setInterval(doAnim, 15);
function createMovieClip()
{
    counter++;
    createEmptyMovieClip('contentarea' + 'counter', 'counter' + 1);
    this['contentarea' + 'counter']._x= 17;
    this['contentarea' + 'counter']._y= 107;
    this.getDepth();
    trace(this.getDepth())
}
function doAnim()
{
    var currMC = _root['contentarea' + 'counter'];
    if(animIndex < 12)
    {
        var time = animIndex/14;
        var dist = 0.5*Math.sin(Math.PI*(time-0.5)) + 0.5;
        with(currMC)
        {
            clear();
            beginFill(0x009900);
            lineTo(mWidth,0);
            lineTo(mWidth,dist*175);
            curveTo(350,dist*40,10,10*dist);
            endFill();
        }
    }
    else if (animIndex < 28)
    {
        var time = (animIndex-12)/22;
        var dist = 0.5*Math.sin(Math.PI*(time-0.5)) + 0.5;
        with(currMC)
        {
            clear();
            beginFill(0x009900);
            lineTo(mWidth,0);
            lineTo(mWidth,175);
            curveTo(350-100*dist,50+250*dist,10,20+280*dist);
            endFill();
        }
    }
    else if (animIndex <= 50)
    {
        var time = (animIndex-25)/25;
        var dist = 0.5*Math.sin(Math.PI*(time-0.5)) + 0.5;
        with(currMC)
        {
            clear();
            beginFill(0x009900);
            lineTo(mWidth,0);
            lineTo(mWidth,175+175*dist);
            curveTo(130,190+160*dist,10,350);
            // change 4th number to change bottom left
            endFill();
        }
    }  
    animIndex++;
    if(animIndex > 50)
    {
       stop();
    }
}
stop();

```

p p please help. thanks guys
