Masking (AS3) [SOLVED]

3 posts

Flag Post

I want to create a movieclip that will act as a mask for another movieclip that has been added to the stage. I am wondering if there is a way to do this possibly using movieClipInstanceName.mask(otherMoiveClipInstanceName) or something to that effect but I don’t know how .mask function works or if its even the type of thing I am looking for.

Any ideas?

 
Flag Post

Here is how:-

var movieToBeMasked:MovieClip = new MovieClip();
//addChild whatever you need to mask in this movie here
//alternatively you can directly add a movieclip to your movieClipToBeMasked and assign movieToBeMasked.mask = mask1;
//finally
var mask1:MovieClip = new someMovieClip();
movieToBeMasked.addChild(mask1);
mask1.x = 10; //place the mask at appropriate place
mask1.y = 10;
movieToBeMasked.mask = mask1;
 
Flag Post

Thank you works fine :)