Search code examples
flashactionscript-2maskmasking

How do you create an inverse mask using AS2?


Possible Duplicate:
Flash inverted mask

So here's the mask:

imageMC.setMask(maskMC);

This displays the masked area, and nothing outside of it. What I need to do is the opposite; to display only the unmasked area. I need to do this dynamically with code.


Solution

  • EDIT:

    Try using the blendMode method:

    // `mainMC` and `maskMC` are MovieClip objects in the FLA library.
    
    this.attachMovie("mainMC", "main", 10);
    main.attachMovie("maskMC", "punchout", 11);
    
    main1.cacheAsBitmap = true;
    main.punchout.cacheAsBitmap = true;
    
    main.blendMode = "layer";
    main.punchout.blendMode = "erase";