If you're using the drawing API to make the mask shape, you can make an
inversion of it (to show everything but the mask shape) by giving the
commands to draw the overall shape (ie, that covers the whole stage if
that's what you want) and then the commands to draw the shape of the
mask, in the reverse direction of the original drawing -- ie, draw the
mask clockwise if the original shape was drawn counterclockwise--, and
do both sets of commands between the beginFill and endFill. Example
here http://flash-creations.com/notes/dynamic_drawingapi.php#cutout
under "Using a shape with a cutout as a mask" if you need.
Helen
Ville Walveranta wrote:
Hello everybody,
I've been racking my brain tonight trying to figure out a way to create a
reverse mask in Actionscript. I'm working on an application which is
entirely object-based; nothing on the stage other than object initialization
on the first frame. So everything needs to be programmatic.
Normally a mask displays what's on the underlying layer. I'm trying to
create a mask that would display an intermediate layer for the areas outside
of the mask shape, and basically be "invisible" for the areas of the mask
shape showing all underlying layers, whtever is displayed at that spot from
below.
An illustration (as viewed from the side :) may help...
[--] <- mask layer containing a shape, say a box in the middle
[------] <- an intermediate layer whose contents would be shown in
the areas *outside* of the above box-shaped mask
[ ] <- various content layers
[- -- -] <- whose visible content would
[--- - --] <- show through the mask
[--] <- on the top
I found a short comment by someone ("Xeef") on Actionscript.org regarding
"reverse mask" as follows:
"" you will need to use more masks
"" BackGround --Box on it -- An other Background Masked by an EMPTY mask
"" (will by invisible) now draw on the Mask the part of the 2. Backgound
"" will by revaled and over lap the Box
I haven't figured out yet what that means.
Any suggestions, ideas, thoughts?
Thanks!
Ville
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com