This content has been marked as final. Show 5 replies
1. you have a mask and you want to "invert" the alpha of each pixel?
2. by pivot do you mean the point around which your movieclip pivots when its _rotation is changed? if so, that's its registration point and it can be set anwhere on-stage.
1) Yes. e.g. say I have a cheeseWedge_mc and polkaDots_mc and I want to make swiss cheese. If I do cheeseWedge_mc.setMask(polkaDots_mc) I get lots of little circular cheese dots. Is there anything I can do to get the cheeseWedge_mc to show up with circular holes in it like swiss cheese instead?
I thought that making a ColorTransformMatrix where row 4 (the alpha row) was (0,0,0,-1,1) (i.e. newAlpha = 1-oldAlpha) would invert the mask but it seems to just make the mask disappear entirely instead.
2) Ah, "registration point". I am really new to flash, so I did my help searches on "origin", "pivot", "center", etc.. I will check the help when I get home - thanks!
Thanks a lot,
1. create a polka dot movieclip consisting of many polka dots. create a bitmapdata instance and use the draw method of the bitmapdata class to create a bitmapdata instance of your polkadot movieclip. apply the palletMap method of the bitmapdata class inverting the alpha of your polkadot bitmapdata instance. attach your bitmap to a movieclip. use the movieclip with the inverted bitmap as your mask.
you may need to enable the cacheAsBitmap property of your mask and masked movieclips.
Ah, I figured everything out.
1) Actually, the ColorTransformMatrix does work, but I didn't realize that alpha was 0-255, not 0-1 (you'd think after being bitten by MovieClip scales being 100 = 100% instead of 1 = 100%, I'd have guessed, but...). So a ColorTransformMatrix of
(1 0 0 0 0)
(0 1 0 0 0)
(0 0 1 0 0)
(0 0 0 -1 255)
applied to the mask will successfully invert it. Nice.
2) Apparently I had previously messed up grabbing all the images and dragging them - I had forgotten to turn onion skinning to "onion all" so that I could actually see everything (all my images are all on top of each other so it wasn't obvious I didn't have everything visible). I had been selecting all the frames and dragging the images around in relation to the registration point, but only the last 3 frames were actually moving, and they happened to be a part of the animation I didn't bother triggering while testing. Oops.
Thanks much for your help.