Flash/Flex Tidbit #2 How to use Alpha Mask in Flash CS3
Oct21
So the other day I spent 2hrs looking for how to and trying to do an alpha mask (I’ve done on once). So like an idiot I was trying to do it the Photoshop way with level of gray.
My method of thinking
- Black = 100 and White = 0
- but it doesn’t matter what color only the opacity.
If you have never mad a alpha mask in Flash before or CS3 it’s easy.
- open a fla
- draw a shape
- Make that shape a MovieClip
- name it maskee_mc
- draw a second shape
- use a linear gradient
- choose color
- set one linear color alpha at say, 40
- Make that second shape another MovieCilp
- name it mask_mc
[as]
this.mask_mc.cacheAsBitmap = true;
this.maskee_mc.cacheAsBitmap = true;
// as2 was maskee_mc.mask(mask_mc);
maskee_mc.mask = mask_mc;
[/as]
That’s it!