thoughts on art, interactivity, technology, design, culture & life

My friend Justin recently asked me if I knew how to invert a mask in AS3. Technically of course this is not possible (at least as far as I know). You can however nest the DisplayObject you wish to mask and a copy of the original mask in a Sprite or MovieClip and use the LAYER and ERASE blend modes to create the desired effect.

You can get the source code for this HERE. I hope this helps.

Comments
  1. Justin04.13.2009

    Thanks again rachel. Lets hope in CS5 there’ll be a checkbox instead :P

    ReplyReply
  2. fattymelt08.28.2009

    I have no idea why I didn’t find this when I was looking for it a month ago, but this is EXACTLY what I was looking for. You wouldn’t believe the workaround I used to accomplish this. Thanks so much!

    ReplyReply
  3. Patricio Brito05.25.2010

    Hello,
    Rachel

    With the code friispray (Stuart Childs/ and Graffiti AS3 library (Ben Rhodes), I developed an new application to simulate digital graffiti.

    Now in version 1.2, I would like to implement the option to use stencil. Therefore, I believe that through the function (inverse mask), I can create a palette of stencils. However, I am designer who sees a bit of AS3, but I’m not a programmer! :)

    So, I liked to take a help of a professional. What kind of code you can suggest to put on a stage a shape (stencil), for when I paint on it, stay the effect of stencil?

    I would be grateful for your assistance…

    Cheers,
    PatrĂ­cio Brito (Portugal)

    P.s. – You can see my project here: http://vimeo.com/channels/34718

    ReplyReply

Back to Home
Preload image Preload image Preload image Preload image Preload image