(Accidentally hit reply before I finished typing).
I'm pretty sure this is just buggy, I can supply an CS4 FLA that demonstrates the inconsistencies, but I was wondering if these problems are well known / are there any workarounds I should try.
1 person found this helpful
i'm not sure there are any inconsistancies but, the draw() method "draws" the untransformed object. ie, it doesn't matter where your movieclip is positioned, unless you use the matrix parameter to adjust for movieclip transforms, the bitmapdata object will look the same (as the untransformed object).
Hi kglad, so the transformation of the movieclip that you're Draw()ing is determined by the matrix, but the position of its mask is determined by its _x, _y, etc. The inconsistencies are in how flash interprets those properties, eg sometimes it takes the _x, _y as relative to the MovieClip that you Draw(), sometimes they're absolute, etc.
I'm trying to work around this by doing the mask myself:
1) Draw the object to be masked to a staging area
2) Copy the alpha channel of the staging area to a color channel in a second staging area. Can't do alpha subtraction with BitmapData.draw(), have to copy the alpha to a color channel.
3) Copy the mask bitmap's alpha channel to a color channel in a third staging area.
4) Subtract the third staging area from the second
5) Copy from the second staging area back to the first staging area's alpha channel
6) Render the first staging area to the target
This technique seems to work, so if perf is OK then my problems are solved. Still, if anyone has an explanation for the masking problems I'd be interested. Or, is there a way to send adobe an FLA that demonstrates the problem / would they look at it and fix in a future version of flash?
This is an old issue but comes up as first in google when looking for the offset of the mask when drawing a movieclip to a bitmap. The solution that worked for me I found here: http://stackoverflow.com/questions/9096504/as3-get-bitmap-from-movieclip-with-mask
that's an as3 solution, not as2.