Learn how to create advanced mask effect in flash 8 using the Action Script.You will also learn:
1. How to design a modern 3d cube.
2. How to use Advanced color settings in the Properties Panel.
3. How to create Motion Tween and more.
Step 1
Start Flash. Select Modify > Document (shortcut key: Ctrl+J ). Set the width of your document to 250 pixels and the height to 200 pixels. Select #E8E8E8 as background color. Set your Flash movie's frame rate to 30 fps and click ok. See the picture below.
Step 2
Now, it's time to create a modern 3d cube. So, take the Line Tool (N) and go to the Properties Panel (Ctrl+F3) below the stage.Then, choose the Following options:
1.Select a black as line color.
2.Choose Solid as type of line, with thickness set to 1.
Step 3
Then, draw this part of cube:
Step 4
After that, draw this:
and then, this:
and finally this:
Step 5
Take the Paint Bucket Tool (B), for Fill color set #D90504 and paint the cube. See the picture below.
Step 6
Take the Selection Tool (V) and select a cube. Then, press F8 key (Convert to Symbol) to convert this cube into a Graphic Symbol. See the picture below.
Step 7
Click on frame 10 and press F5 key.
Step 8
Create a new layer and name it masked layer. After that, using the "drag and drop" technique, move it below the first layer (layer 1). See the picture below.
Step 9
Select masked layer and take the Rectangle Tool (R). In the Colors portion of the Tool panel, block the Stroke color by clicking on the little pencil icon and then on the small square with the red diagonal line. For Fill color choose any color and draw a "rectangle" about 800x200px and place it on the position like it is shown on the picture below.
Step 10
While the rectangle is still selected, go to the Color Mixer Panel (Shift + F9). Then, set the following options:
1. Click on the paint bucket icon to access the fill color options.
2. Select the Linear option in the Type drop-down menu.
3. Click the small color square on the left.
4. In the color hex code input field, enter #FFFFFF .
5. Click on the right small square and enter #FFFFFF in the hex code field and turn down its alpha factor to 0%.
Now, you have this:
Step 11
While the rectangle is still selected, press F8 key (Convert to Symbol) to convert this recatngle into a Movie Clip Symbol.
Step 12
Click on frame 10 and press F6 key.
Step 13
Then, take the Selection Tool (V) and place the rectangle on the position like it is shown on the picture below.
Step 14
Right-click anywhere on the gray area between the two keyframes on the timeline and choose Create Motion Tween from the menu that appears. See the picture below.
Step 15
Go back on the first frame of layer 1 and press Ctrl+C key (Copy).
Step 16
Create a new layer (layer 3) and place it below the all layers. See the picture below.
Step 17
Click on frame 11 of layer 3 and press F6 key. After that, press Ctrl+Shift+V key (Paste in Place).
Step 18
Press F6 key twelve time. Go back on keyframe 2, take the Selection Tool (V), click once on the cube to select it and go to the Properties Panel (Ctrl+F3) below the stage. On the right, you will see the Color menu. Select Advanced in it, click on Settings button and set the following options:
Step 19
Select keyframe 4 and repeat the previous step.
Step 20
Click on keyframe 5, take again the Selection Tool (V), click once on the cube to select it and go to the Properties Panel (Ctrl+F3) below the stage. On the right, you will see the Color menu. Select again Advanced in it, click on Settings button and set the following options:
Step 21
After that, select keyframe 6 and set the following options:
Step 22
Select keyframe 7 and set the following options:
Step 23
Select keyframe 8 and set the following options:
Step 24
Select keyframe 9 and set the following options:
Step 25
Select keyframe 10 and set the following options:
Step 26
Select keyframe 11 and set the following options:
Step 27
Select keyframe 12 and set the following options:
Step 28
Click on frame 25 and press F6 key. While you're still on frame 25, take again the Selection Tool (V) and click once on the cube to select it. Then, go to the Properties Panel below the stage. On the right, you will see the Color menu. Select again Advanced in it, click on Settings button and set the following options:
Step 29
Go back on keyframe 12 (frame 22) and open the Properties Panel (Ctrl+F3). Then, select Motion from the Tween menu.

Step 30
Click on frame 25 and press F6 key. Then, select again a cube and go again on the Properties Panel below the stage. On the right, you will see the Color menu. Select None in it.
Step 31
Click on frame 45 and press F6 key. Them, press F8 key (Convert to Symbol) to convert this graphic symbol (cube) into a Movie Clip Symbol.
Step 32
Double-click on the movie clip on stage with the Selection tool (V). You should now be inside the movie clip.
Step 33
Click on frame 3 and press F6 key. Then, press right-click anywhere on the gray area between the two keyframes on the timeline and choose Create Motion Tween from the menu that appears.See the picture below.
Step 34
Click again on frame 3 and press F6 key fourteen times.
Step 35
Go back on keyframe 3 (frame 4), and repeat step 18.
Step 36
Select keyframe 5, and after that keyframe 7 and repeat again step 18.
Step 37
Select keyframe 8 and repeat step 20.
Step 38
Select keyframe 9 and repeat step 21.
Step 39
Select keyframe 10 and repeat step 22.
Step 40
After that, select keyframe 11,12,13,14,15 and 16 and repeat steps 23-28.
Step 41
Click on frame 20 and press F6 key.
Step 42
Go back on keyframe 16 and open the Properties Panel (Ctrl+F3). Then, select Motion from the Tween menu.
Step 43
Create a new layer and name it Action. After that, select frame 1 and press F6 key three times. See the picture below.
Step 44
Go back on the first frame, open the Action Script Panel (F9) and enter the following Action Script code inside the Actions Panel:
E = Number(getTimer()) + Number(random(10000));
Step 45
Click on frame 2 and enter this code inside the Actions Panel:
if (Number(E) < Number(getTimer()))
{
gotoAndPlay(4);
}
Step 46
And finally, click on frame 3 and enter this code inside the Actions Panel:
gotoAndPlay(2);
Step 47
Go back on the main scene (Scene 1).
Step 48
Select layer1 layer and convert it to a mask by right-clicking on the layer1 layer and selecting Mask. See the picture below.
Step 49
Create a new layer above the layer1 and name it Action layer.
Step 50
After that, click on frame 45 and press F6 key.
Step 51
Then, open the Action Script Panel (F9) again and enter this code inside the Actions panel:
stop();
We're done!
Test your movie (Ctrl+Enter).
Download source file (.fla)
discuss this topic to forum
