Saturday, 15 June 2013

masking and unmasking in actionscript 3 -



masking and unmasking in actionscript 3 -

i created mask image. want know how can know if image has been revealed? code...

var sc : scratch_card = new scratch_card (); var bg: background = new background (); var mouseclick:number; var masking:sprite = new sprite() addchild (sc); sc.x=20; sc.y=40; addchild (bg); bg.x=20; bg.y=40; addchild(masking); bg.mask = masking; stage.addeventlistener(mouseevent.mouse_down, prsing); stage.addeventlistener(mouseevent.mouse_move, mving); stage.addeventlistener(mouseevent.mouse_up, lfting); function prsing(event:mouseevent):void { mouseclick = 1; } function mving(event:mouseevent):void { if (mouseclick == 1) { masking.graphics.beginfill(0x000000); masking.graphics.drawellipse(mousex, mousey, 70, 60); masking.graphics.endfill(); } } function lfting(event:mouseevent){ mouseclick = 0; }

how can know if image has been unmasked algebraically...

edit:

function lfting(event:mouseevent){ if (masking.x - masking.width < bg.x ){ trace ("u cleaned it"); } mouseclick = 0; }

actionscript-3 masking

No comments:

Post a Comment