PDA

View Full Version : need help with transparency gradient in mask layers


carlhusic
01-02-2003, 06:01 AM
I'm working with Flash 5 (will buy MX upgrade if I regain employment).

I am trying to use transparency gradients in a mask layer for a
spotlight effect over another layer containing an image.

I create a circle with a radial gradient, setting the alpha on one
end to 0 and to 100 on the other end.

When I test the movie, the circle area in the mask, revealing the
layer under the mask has hard edges - I cannot get
a transparency gradient effect.

If I make a regular layer over the image area and use a gradient
with the inner part at 0% and the outer part at 100%, and
fill the remaining space on the top layer with the solid color,
it works just fine.

Shouldn't I be able to use the alpha gradients on a mask layer
and get a mask with diffuse edges? Is there some trick to this?

Thanks,
Carl

bembino
01-02-2003, 07:28 AM
Masks can't have alpha values. People that do it use a work around of sorts that duplicates a masked clip increasing its size while decreasing its alpha value. Then make sure all the duplicated clips are lined up.

carlhusic
01-02-2003, 03:19 PM
Thanks bembino -

I guess the book I was reading lied to me then (not the first time)

So I create multiple masks overlaying each other each with an
increased alpha value - OK, I'll give that try.

Basically I'll want to write actionscript to detect cursor position
and move the spotlight with the cursor (I know, it's a realtively
fundamental thing). I noticeed that if I put a rectangle with a
gradient hole in it over the image layer, I also get the effect I
want.

So what would be more efficient, code-size and processor-usage
wise - to make multiple masks that follow the cursor, or one
overlying layer containing a large rectangle with the hole in it?

bembino
01-02-2003, 03:41 PM
I would say moving the large fill with a gradient hole in it would probably be fastest. You're moving one object vs 4 to how ever many objects with alpha values.