all groups > macromedia flash sitedesign > february 2006 >
You're in the

macromedia flash sitedesign

group:

transparrency on a mask?


transparrency on a mask? fretfingers
2/1/2006 7:21:58 PM
macromedia flash sitedesign:
I wanted to know of a mask had to be a solid color.

I have a black and white picture, and a colored picture on top. I want a small
flash of color to run from top to bottom. But I want the edges of the mask to
fade to transparrent so the swipe of color is not so harsh.
Re: transparrency on a mask? tralfaz
2/1/2006 11:59:26 PM
[quoted text, click to view]

You can fade the edges of images but you cannot move that fade around
on the image. Flash doesn't make it easy. Masks are fully on or off,
no fades allowed on masks. (except maybe Flash8.. not sure) The
color or alpha of the mask makes no difference at all. There is a way
to do it though. Something I worked on some years ago as a challenge.
It's done with Actionscript.

Here is an example with mx sourcecode.
http://members.cox.net/4my5cats/color/colorGradientMask.html

I wrote the thing in such a way that the color band can be adjusted
just by changing the various settings at the top of the Actionscript
page. You can speed up the effect by having wider alpha bands but the
gradient won't look as smooth. It took me a long time to get this
working right! Somebody had said it couldn't be done so of course I
had to do it. You can also do it without Actionscript by stacking the
images and masks on the timeline and tweening them but it's a lot of
work.

tralfaz

Re: transparrency on a mask? tralfaz
2/2/2006 10:31:03 AM
[quoted text, click to view]

Sorry.. I can't open that Flash version, only Flash 6 (MX).
If you have MX2004, save as version 6 fla so I can look at it.
If you have Flash 8, put the swf on your website and I can convert the
swf to a version 6 fla to look at it that way.
tralfaz

Re: transparrency on a mask? tralfaz
2/2/2006 4:34:14 PM
[quoted text, click to view]

You will need 2 copies of the picture. The black-and-white picture
and a color one.
The black and white goes on stage like you have it now. Import into
the library the color version of the picture. Drag it to the stage
and then convert it to a movieclip. Then delete it from the stage.
Give it an instance name of colorPic inside the library. That picture
is going to be in the library only, not on stage. It is attached 60
times over the top of the black-and-white picture with the code.
The rest is ok.
tralfaz

Re: transparrency on a mask? fretfingers
2/2/2006 5:26:41 PM
thank you sooooo much,..I will do my best to figure this out!
Re: transparrency on a mask? fretfingers
2/2/2006 5:47:37 PM
I tried...what did I do wrong?

Re: transparrency on a mask? fretfingers
2/2/2006 10:31:52 PM
ok,..heres the .swf as i have flash8

Re: transparrency on a mask? tralfaz
2/7/2006 4:20:48 PM
[quoted text, click to view]

Just increase the bandHeight value. The thicker the mask bands, the
faster it moves. (Thicker bands make the gradient less smooth though)
tralfaz

Re: transparrency on a mask? fretfingers
2/7/2006 9:18:02 PM
GOT IT!!! It works now...

AddThis Social Bookmark Button