Gradient mask in Flash?

Out of context: Reply #8

  • Started
  • Last post
  • 10 Responses
  • fyoucher10

    Couple of ways to do it.

    Manual way using blending modes:
    - Create two clips. A clip that you want to mask. And another clip above that clip which will be your mask (it can be a static mc or an mc with a bunch of shit animated inside).
    - Set the mask clip's layer mode to "Alpha".
    - The mask clip can be whatever you want. Literally. Transparent areas within that clip (0% alpha) will not show anything. Things that are 100% alpha will show 100% of the shit. Places where you don't have anything will show at 100%. TIP: I usually put a layer at the bottom of the mask clip which is just a big rectangle at 0% alpha. Then I layer things of 100% alpha on top of it, or gradients, or whatever you want.
    - Set the mask clips "cacheAsBitmap" prop to true. You can put it inside of that timeline if you want to (this.cacheAsBitmap = true).
    - Select both of those clips and create a container clip (nesting both clips into one clip, parent/child). This will hold the clip you want masked AND the mask. Set this parent mc's blending mode to "Layer". Voila. Do this all of the time.

    That's the manual way to do it. This works well for more complicated mask animations. More than just one gradient sliding across. You can literally put a ton of shit in that mask clip.

    Then there's the code way. See Noneis's post above.

View thread