# Mask a duplicated movieclip, please help

**URL:** <https://forum.kirupa.com/t/mask-a-duplicated-movieclip-please-help/331364>\
**Category:** Uncategorized\
**Created:** [July 15, 2013, 2:53pm UTC](https://forum.kirupa.com/t/mask-a-duplicated-movieclip-please-help/331364 "2013-07-15T14:53:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![user\_B](https://avatars.discourse-cdn.com/v4/letter/u/f9ae1b/32.png) [@user\_B](https://forum.kirupa.com/u/user_B)\
**Post date:** [July 15, 2013, 2:53pm UTC](https://forum.kirupa.com/t/mask-a-duplicated-movieclip-please-help/331364/1 "2013-07-15T14:53:37Z")

</div>

Hi all,  
I’m working on a project of flying heart kind of thing, so I’m duplicating hearts and everything runs fine, however, I need these hearts to be masked to display other informations but can’t find a way to have a mask over these duplicated movieclips. I’m sure this is a very simple matter but not the greatest AS coder. Thanks for the help. Below a sample of the working code:

```auto

maxhearts = 40;

var hearts = new Array();

for(i=0;i<maxhearts;i++)
{
hearts* = heart.duplicateMovieClip("heart"+i,1+i);

//import blur effect
import flash.filters.BlurFilter;
var blur:BlurFilter = new BlurFilter(Math.random()*10+ 1,Math.random()*5+ 1,Math.random()*3+ 1);

// put it in random place
hearts*._x = Stage.width*Math.random();
hearts*._y = Stage.height*Math.random();
hearts*._xscale = 40+Math.random()*60;
hearts*._yscale = hearts*._xscale;
hearts*.yspeed = Math.random()+0.5;
hearts*._alpha = 10+Math.random()*100;
hearts*.filters = [blur];
hearts*.increment = -0.025+Math.random()*0.05;

hearts*.onEnterFrame = function() {
this.radians = this.increment + this.radians;
this._y = this._y - this.yspeed;
this._x = Math.sin(this.radians) + this._x;
if (this._y<-40) {
this._y = Stage.height;
this._x = 0-10+Math.random()*Stage.width;
}
}
}

```
