# Tweening a dynamic mask with AS3

**URL:** <https://forum.kirupa.com/t/tweening-a-dynamic-mask-with-as3/239883>\
**Category:** flash\
**Created:** [September 26, 2007, 8:22pm UTC](https://forum.kirupa.com/t/tweening-a-dynamic-mask-with-as3/239883 "2007-09-26T20:22:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shellbryson](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@shellbryson](https://forum.kirupa.com/u/shellbryson)\
**Post date:** [September 26, 2007, 8:22pm UTC](https://forum.kirupa.com/t/tweening-a-dynamic-mask-with-as3/239883/1 "2007-09-26T20:22:40Z")

</div>

Hi guys,

Probably making a really silly mistake here, but I can’t see it. This code generates a bunch of circles, sticks them to a MovieClip then uses that clip as a mask. All that works, but now I want to animate these circles. Nothing happens - the whole thing just stops when I use the tween class. Any ideas?

```auto

var theMask:MovieClip = new MovieClip();

function addLotsOfShapes():void {
    for (var i:int = 1; i < 200; i++) {
        addShapes();
    }
    addChild(theMask);
    pagesLayout.mask = theMask;

}

function addShapes():void {
    // DRAW THE CIRCLE
    var circleMaskShape:MovieClip = new MovieClip();
    circleMaskShape.graphics.lineStyle();
    circleMaskShape.graphics.beginFill(0xff000000);
    circleMaskShape.graphics.drawCircle(_cmX,_cmY,10);
    circleMaskShape.graphics.endFill();
    circleMaskShape.x = Math.random() * 1800;
    circleMaskShape.y = Math.random() * 1270;
    
    var circleMaskShapeX = new Tween( circleMaskShape, "scaleX", Strong.easeIn, circleMaskShape.scaleX, 15, 3, true );
    var circleMaskShapeY = new Tween( circleMaskShape, "scaleY", Strong.easeIn, circleMaskShape.scaleY, 15, 3, true );    

    theMask.addChild(circleMaskShape);
}

```
