Publishers of technology books, eBooks, and videos for creative people

Home > Blogs > Flash Animation Five Tips in Five Days: Tip 3 - Bitmap Masking

Flash Animation Five Tips in Five Days: Tip 3 - Bitmap Masking

Did you know that bitmaps (jpgs, pngs, gifs, tiffs) can be used to fill shapes in Flash? When a bitmap is used for a fill, the shape containing the fill acts as a mask.

To convert an imported bitmap on Stage to a rectangle with a bitmap fill, simply break the bitmap apart (Modify > Break Apart).


You can then manipulate the edges of the shape.



You can use the drawing tools (e.g., Eraser, Line Tool, Pen, etc) to alter and cut pieces out of the shape.


You can select and delete the parts of the shape that you want masked.


By masking your bitmap with a shape, you don't need to maintain a separate mask layer (or worry about locking the layers to see the mask's effect). The result will be a bitmap with a custom mask that is immediately visible.


This masking technique can also be useful if your bitmap is inside a movie clip that you're trying to control with ActionScript. If you've masked a large image using a layer mask, the container's width and height properties will reflect the size of the unmasked bitmap, and not that of the masked result. If you mask your bitmap using the technique in this tip, the container's width and height properties will match what you are seeing on Stage.


Even if you're not going to use ActionScript in your movie, it's still great to see your mask in action as you're creating it!

For more tips and step-by-step, illustrated instructions for creating animation in Flash, check out Animation with Scripting in Adobe Flash CS5 Studio Techniques.