Saturday, September 19, 2009
Masking is revealing portion of your picture or graphic in the layer below.
While surfing through net you might have come across lots of beautiful Flash effects such as ripple effect , some wording with sky background or glitter bordering an object, and wondered "How? What is the logic behind this". The answer for all this is masking.
This tutorial will teach you the basics of masking in Flash MX 2004. The download .fla file is also included at the end of the tutorial.
1. You need to have Flash Player 7.0 installed to view the Flash animation.
2. Flash MX 2004 must be installed in your system to download and view the .fla file.
I shall start this tutorial assuming that the reader has basic knowledge of flash such as Shape Tween and working with layers.
Okay! if you are ready, just follow the steps given below.
STEPS TO FOLLOW
Inserting Layers and Naming them
- By default you will have a layer in your timeline window. Insert one more layer, totally you need two layers to mask an object.
- Rename the top layer to "Mask" and the layer below that to "background".
Creating Shape Tween
- Import your picture to the "background" layer.
- Using Oval tool from your tool box, draw a circle in your "Mask" layer and delete it's border.
- Drag the circle to one end of your picture.
- Now go to"frame 40" of your "Mask" layer and press "F6" to insert a new keyframe.
- Now go to "frame 40" of your "background" layer and press "F5" to insert frames, so that your background image is available all through your mask.
- Select "frame 40" of your "Mask" layer, that is your new keyframe, Keeping the playhead on "frame 40" of "Mask" layer, drag the circle to other end of your picture.
- Now go back to "frame 1" of your "Mask" layer, keeping the playhead on "frame 1" of your "Mask" layer, select Shape tween in your properties window.
- Right click on the "Mask" layer (the area where you named the layer not where the frames exist) and select Mask.
Your Mask is all ready. Press Ctrl+Enter to view your Mask.
New Document window will appear
Select General panel and choose Type: Flash Document . Press OK.
* If your timeline window is not open, press (Ctrl+Alt+T).
* Now you can see a single Layer called "Layer1" in your timeline Window.
* Select the first frame. Now go to your working area and draw any object. To start off with, may be you can draw a circle.This is going to be your initial object.
In the above demonstration, my initial object is a short line.
* Select frame 20 and press F6 to insert a new keyframe.
* Still keeping playhead on frame 20, delete the object present in your working area. Now draw a different object, may be a square.
In the above demonstration, I have drawn a long line.
* Select any frame between, 2 to 19 and select Shape from the tween pop-up menu in the Property inspector. Now your Layer will look something like the one shown below.
* Now press (Ctrl+Enter) to view your motion tween.
In the above tutorial, you learnt how to create a simple shape tween. Believe me, using this logic you can create n number of beautiful things. Here is a simple example just to trigger your creativity.
* If you have already finished motion tween, to see the combined effect of motion and shape tween