I have a MovieClip inside a stage that is mostly(not accurately) centered to the middle of the stage.
When I try to save the MovieClip into a bitmap in order to upload it to facebook, I either get a cropped image or a white image(blank).
Here is the code for generating the bitmap:
var source:BitmapData = new BitmapData(board.width, board.height);
source.draw(board);
var bitmap:Bitmap = new Bitmap(source);
The result I am getting is the yellow area in the following image:
I am also experiencing issues with coordinates when adding new items to the MovieClip which may be related, such as having to set the x and y manually for the item i am adding to the MovieClip as it does not add itself from position 0,0 of the MovieClip.
On things that are based on direct interaction mc.mouseX and mc.mouseY add to the correct location, however on things that are not I have to set the coordinates using fixed numbers.
The flash is built on top of the main stage area, having several MovieClips at the sides acting as buttons and the "board" MovieClip which is what i'm trying to save.
How would I need to go to either reset the coordinates correctly for the MovieClip or crop the image from the main stage?
I have tried using localToGlobal to crop the image but with no success with the following code:
var point:Point = new Point(stage.x, stage.y);
board.localToGlobal(point);
var rect:Rectangle = new Rectabgle(point.x, point.y, board.width, board.height);
var source:BitmapData = new BitmapData(board.width, board.height);
source.draw(stage, null, null, null, rect, true);
var bitmap:Bitmap = new Bitmap(source);