Friday, January 23, 2009

Gradient Masks in Flash

Flash does gradients. Flash does masks. But combining the two? Not so simple.

It took a few hours of web searching, but finally somewhere I found a pretty easy solution.

For me, gradient masks allow for smoothing effects of alterable doll parts. I first used them in the mermaid. You'll notice that some of the tails "blend" into the body, yet both the color of the skin and tail can be changed by the user.

1. Your mask must be in a movie clip, the object to be masked must be in a separate movie clip, and BOTH of those have to be in one all-encompassing movie clip (see bottom picture at right).

2. You actually don't use Flash's "Mask" function at all, so stop touching it! It's all done through the "Blend" toggle, in the Properties panel. Set the Blend as follows (see bottom picture at right):

- All encompassing movie clip: "Layer"
- Masking movie clip: "Erase"
- Movie Clip to be masked: "Normal"

3. The tricky part: The mask will work in reverse of the regular Flash mask (see top picture at right). The parts you want to show must be BLANK, and the parts you want to hide must be OPAQUE.

The good news? You can go to town on the gradients here, and it should work. Eg. A mask with 25% opacity will let the object below show with a 75% opacity etc.