Dynamic Mask

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

Use setMask,

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 :slight_smile:

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