# Dynamic Mask

**URL:** <https://forum.kirupa.com/t/dynamic-mask/25666>\
**Category:** flash\
**Created:** [July 15, 2003, 3:47pm UTC](https://forum.kirupa.com/t/dynamic-mask/25666 "2003-07-15T15:47:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![QBA](https://avatars.discourse-cdn.com/v4/letter/q/e0b2c6/32.png) [@QBA](https://forum.kirupa.com/u/QBA)\
**Post date:** [July 15, 2003, 3:47pm UTC](https://forum.kirupa.com/t/dynamic-mask/25666/1 "2003-07-15T15:47:22Z")

</div>

I’m creating a list of images dinamically that I want to mask.

This is the script I’m using:

for (i=0; i\<10, i++) {

img\_MC = createEmptyMovieClip(“image” + i, 3\*1);  
img\_MC.loadMovie(“image” + i + ".jpg);

}

The images are loading fine but I can’t get it to mask

Any ideas how can I a mask Dynamically every image on the list?

Thanks

Alex

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 15, 2003, 4:50pm UTC](https://forum.kirupa.com/t/dynamic-mask/25666/2 "2003-07-15T16:50:09Z")

</div>

Use setMask,

```auto
for (i=0; i<10; i++) {
        
        img_MC = createEmptyMovieClip("image" + i, 3*1);
        img_MC._x = 20;
        img_MC._y = 20;
        
        img_MC.loadMovie("image" + i + ".jpg");
        //some sort of checking bytes loaded to see if img has been loaded
				mask_MC = createEmptyMovieClip("image" + i, (3*1)+1);
				mask_MC._width = img_MC._width;//obviously vary mask size here
				mask_MC._height = img_MC._height;
				mask_MC._x = img_MC._x;
				mask_MC._y = img_MC._y;
				img_MC.setMask(mask_MC);//set mask
			
}

```

Of course this will need a little tweaking with some sort of function to check whether img has been loaded (ie check the bytes loaded in the img\_MC clip reflects totoal bytes of img) …I dont have a chance to test it, but I hope it gives you an idea 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 15, 2003, 6:34pm UTC](https://forum.kirupa.com/t/dynamic-mask/25666/3 "2003-07-15T18:34:25Z")

</div>

Thanks mindfriction

I tried your soluction but I’m still having some problems to get it to work

I put the file in my server, please if you have a sec take a look at it and let me know what m’I doing wrong because I did everything I could to get this to work

ftp://65.49.66.147/Masktest.zip

Thanks again
