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

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s