# Mask effects

**URL:** <https://forum.kirupa.com/t/mask-effects/50089>\
**Category:** Uncategorized\
**Created:** [April 29, 2004, 8:47am UTC](https://forum.kirupa.com/t/mask-effects/50089 "2004-04-29T08:47:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gregory](https://avatars.discourse-cdn.com/v4/letter/g/e56c9b/32.png) [@Gregory](https://forum.kirupa.com/u/Gregory)\
**Post date:** [April 29, 2004, 8:47am UTC](https://forum.kirupa.com/t/mask-effects/50089/1 "2004-04-29T08:47:30Z")

</div>

using zeh’s tween prototype i am trying to create some mask effects with AS. Problem is with positioning ! I have squares on the screen and they mask but i cannot position the first box correctly. I always have one visible through playback. If anyone has any ideas about this or has any other maskin effects to share please come forth 🙂  
Here is my code:

#include “mc\_tween2.as”

this.createEmptyMovieClip(“content”, 10);  
this.content.attachMovie(“content”, “content\_mc”, 10);

this.createEmptyMovieClip(“mask”, 20);  
this.mask.attachMovie(“content”, “contentMask”, 11);

this.mask.attachMovie(“content”, “contentMask2”, 12);

for(i=1; i\<7; i++){  
this.content.attachMovie(“content”, “content”+i, i);  
this.mask.attachMovie(“content”, “mask”+i, i);  
this.content.loadMovie(“myPic”);  
this.content[“content”+i].\_x = 100_i;  
this.mask[“mask”+i].\_y = 100_i+100;  
this.mask[“mask”+i].\_x = 100;  
this.content[“content”+i].setMask("\_root.mask.mask"+i);  
this.mask[“mask”+i].tween(["\_x", “\_y”], [100\*i, 0], 3);  
}
