PDA

View Full Version : BlendMode.LAYER / ALPHA /w code



Esseti
August 24th, 2009, 08:17 AM
Hi, I need a little bit of help.
How can I punch out a alpha hole with the blue circle in the red circle with code? I can't wrap my head around setting up the blendMode properties.

CS3 source.

tjphilli
August 24th, 2009, 11:30 AM
var_rectangle:rect = new rect();
var _mc:MovieClip = new MovieClip();
addChild(_mc);
var _circle:circle = new circle();
_mc.addChild(_circle)
_mc.addChild(rectangle_mc);
_mc.blendMode = BlendMode.LAYER;
rectangle_mc.blendMode = BlendMode.ERASE;



I have two symbols in the library, a rectangle with a class name of "rect", and a circle with a class name of "circle". I brought them out at runtime, into a container mc, and set the container mc's blendmode to layer, and the "cutter" object to .ERASE, if this is what your looking for.