I have a BitmapData object created dynamically that contains user-drawn shapes. I then attach that BitmapData object to a MovieClip via a Bitmap object and set that MovieClip as a mask to another MovieClip. The mask works but the whole bounding rectangle of the BitmapData is acting as the mask. But I want to exclude the transparent portion from the mask so only user-drawn shape can be set as mask. Can anyone tell how to achieve that? Thanks.
A:
Maybe you should try using the Bitmap itself as a mask , if you need that Bitmap to show, try creating another Bitmap using the transparent BitmapData and use that as a mask.
PatrickS
2010-09-15 09:23:37
Tried setting the Bitmap directly as the mask. No luck!
Kayes
2010-09-15 09:27:53
Have you tried playing with BlendMode ( forgetting about the mask I mean )?
PatrickS
2010-09-15 09:32:14
Well, I've done it! We must set the 'cacheAsBitmap' property of both the Bitmap (that will act as the mask) and the MovieClip (on which the mask will be set) to 'true'. Otherwise the mask won't work properly.
Kayes
2010-09-15 11:03:44
Thanks to this post: http://blog.mattiasnorell.com/2010/04/16/dynamic-as3-mask-using-bitmapdata/
Kayes
2010-09-15 11:05:57
well done, thanks for the info!
PatrickS
2010-09-15 12:01:00
Thanks mate for keeping in touch with me :)
Kayes
2010-09-15 15:27:54