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
Actionscript:
-
this.mask_mc.cacheAsBitmap = true;
-
this.maskee_mc.cacheAsBitmap = true;
-
// as2 was maskee_mc.mask(mask_mc);
-
maskee_mc.mask = mask_mc;
That's it!
Last 5 posts in actionscript
- Using Flash Player 10 to produce Dynamic Musical Notes - May 20th, 2008
- Flash Player 10 Dynamic Sound Generation - May 20th, 2008
- How to compile and examples for Flash Player 10 or ASTRO BETA - May 16th, 2008
- How to use Bitmap and BitmapData in ActionScript 3 - v2 - April 23rd, 2008
- How to use Bitmap and BitmapData in ActionScript 3 - v1 - April 21st, 2008
Last 5 posts in as3
- Flash Player 10 Pure Flash Keyboard using SampleDataEvent - September 3rd, 2008
- Using Flash Player 10 to produce Dynamic Musical Notes - May 20th, 2008
- Flash Player 10 Dynamic Sound Generation - May 20th, 2008
- How to load Pixel Bender in Flash Player 10 - May 19th, 2008
- How to compile and examples for Flash Player 10 or ASTRO BETA - May 16th, 2008
Last 5 posts in flash
- Flash Player 10 Pure Flash Keyboard using SampleDataEvent - September 3rd, 2008
- Using Flash Player 10 to produce Dynamic Musical Notes - May 20th, 2008
- Flash Player 10 Dynamic Sound Generation - May 20th, 2008
- How to load Pixel Bender in Flash Player 10 - May 19th, 2008
- How to compile and examples for Flash Player 10 or ASTRO BETA - May 16th, 2008
Last 5 posts in flash CS3
- How to use Bitmap and BitmapData in ActionScript 3 - v2 - April 23rd, 2008
- How to use the FileSystem in AIR to find the users directory folders - March 1st, 2008
- Yahoo Maps ActionScript 3.0 Released - February 11th, 2008
- Update: Flash/Flex Tidbit #2 How to use Alpha Mask in Flash CS3 - January 8th, 2008
- Custom ColorPicker Component - How to extend a Flash CS3 Component Class - December 13th, 2007
Josh Weatherspoon, A self-proclaimed millionaire who for some reason has to work as a Flash Developer, at Travelocity in Dallas(Southlake), TX.
Horaayy..there are 5 comment(s) for me so far ;)
hello!
do you think you could provide a sample fla for this? i cant get it working...
ps: as 2 was setMask(), not mask()
cheers,
Z.
Yeah give me a sec. I'll throw it up there
here is an example:
http://tinyurl.com/233mdo
thanks mate
Sweet. Can't believe how simple this was, after looking through so many other complicated solutions.
Thanks