actionscript 3 - Is It possible to make a Transparent Mask like making an window, on AS3 Flash? -


i want have movieclip make hole on movieclip, putting window on wall. can make mask has same effect right-clicking layer , masking it, not want. want make transparent hole.

i have tried this:

mc1 = new green();  mc2 = new blue();   mc2.blendmode = blendmode.alpha;   addchild(mc1);  addchild(mc2);  mc2.cacheasbitmap = true;  mc1.mask = mc2;  

and this:

mc1.cacheasbitmap = true;  mc2.cacheasbitmap = true;  mc1.setmask(mc2); 

first problem: code gives me errors. second problem: doesn't make hole on movieclip, normal mask.

here code, revised:

var mc1 = new green(); //included var before variable name var mc2 = new blue();  mc2.blendmode = blendmode.erase; //this masking shape erase what's below movieclip(root).blendmode = blendmode.layer; //setting root layer works  addchild(mc1);  addchild(mc2);  mc2.cacheasbitmap = true;  

it appears trying create 'inverted mask,' mask reveals under except located. effect can achieved giving mc2 blend mode of blendmode.erase instead of blendmode.alpha.

check out this article reference.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -