Flash notes three elements of a-alpha channel mask

Source: Internet
Author: User
Notes

Some days did not play Flash, picked up a few exercises today, found in the Lu Congxian Web page to see the alpha channel mask incredibly will not do, error n long, finally found a word in Help, hereby face the wall detention.

Before the Flash8 version, to make a matte mask, you have to make a feather or gradient component on top of the mask block so that it can sync with the mask block, which is bad and troublesome.

Now Flash8 can make a hazy masking effect without having to engage in a third component at all, but you need to remember three factors:

1. The mask and the masked component must be movie clips (MovieClip). because the mask effect of the alpha channel must be done with as, the masking layer is not as if it were a hazy matte-like effect. The statement example is Mc.setmask (MASK_MC).

2. One side of the mask (the one to display) Be sure to select the use run-time bitmap cache option in the Properties panel. Otherwise, the translucent matte effect is definitely not visible, but if you have applied a filter effect to one of the masked sides, it is equivalent to automatically adding a bitmap cache. There is no need to select that option.

3. One side of the mask (the side of the display area), if only a translucent mask, you must select the "Use Run-time bitmap caching" option, otherwise, the translucent mask is invalid. To do a matte mask, you must add a filter and highlight the blur effect in the filter, so you can see the effect.

Combined, that's three steps: Movie clips-Select either use Run-time bitmap caching or add filter effects-use as to complete.

The following is an example step.

Create a new MC, named Ball (same as the instance name in the scene), with a circle filled with any color. Import a picture, F8 into the MC, named IMG (scene instance name), drag all two components into the scene, in the property panel, select the "Use Run-time bitmap caching" option; then enter the following code in the first frame: img.setmask (ball); StartDrag (" Ball ", true). OK, okay.

Effect preview:

Click here to download the source file



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.