5.
Select the instance on the Stage, and then type my_mc into the Instance Name text box in
the Property inspector.
6.
Select Frame 1 of the Timeline, and then type the following code into the Actions panel:
/* When you set cacheAsBitmap, the internal bitmap is opaque and renders
faster. */
my_mc.cacheAsBitmap = true;
my_mc.opaqueBackground = 0xFF0000;
7.
Select Control > Test Movie to test the document.
The movie clip appears on the Stage with the background color that you specified.
For more information on this property, see
(MovieClip.opaqueBackground property)
Using movie clips as masks
You can use a movie clip as a mask to create a hole through which the contents of another
movie clip are visible. The mask movie clip plays all the frames in its timeline, the same as a
regular movie clip. You can make the mask movie clip draggable, animate it along a motion
guide, use separate shapes within a single mask, or resize a mask dynamically. You can also use
ActionScript to turn a mask on and off.
You cannot use a mask to mask another mask. You cannot set the
movie clip. Only fills are used in a movie clip that is used as a mask; strokes are ignored.
To create a mask:
1.
Create a square on the Stage with the Rectangle tool.
2.
Select the square and press F8 to convert it into a movie clip.
This instance is your mask.
3.
In the Property inspector, type mask_mc in the Instance Name text box.
The masked movie clip is revealed under all opaque (nontransparent) areas of the movie
clip acting as the mask.
4.
Select Frame 1 in the Timeline.
5.
Open the Actions panel (Window > Actions) if it isn't already open.
376
Working with Movie Clips
opaqueBackground
in the ActionScript 2.0 Language Reference.
property of a mask
_alpha
Need help?
Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?