flash as3 JPG Encoder – Caution

Looking from the image, the white area is the flash swf canvas aka “stage”, blue area aka “_graphics_container” is the movie clip contents which you want to export as jpg even if it is larger than the mask – the green area aka “_graphics_mask”

While trying to export the contents of a movie clip as jpg image, you are about to experience an undesired result when mask is applied.

A word of caution: Remove the mask before converting the movieclip as bitmapdata and export as jpg, the undesired effect is the white space.
The solution: work around, set the graphics container mask to null
_graphics_container.mask = null;//_graphics_mask

once the image is exported
navigateToURL(jpgURLRequest, “_blank”);
_graphics_container.mask = _graphics_mask
set the mask back again for the container.

Hope that helps
tags: Flash, AS3, JPG encoder, word around