How to copy a bitmap data and store as a global variable

Hi all, i am having problem to recall the copied bitmap data to show on another private function which is difference from the private function which copy the bitmap process.

:stormtrooper:i am new in AS3 so have no idea how do i make the copied bitmap data into a global variable…

heres my sniplet of code:-

private function export():void
{
var bmd:BitmapData = new BitmapData(216.2, 468.29);

                var a_matrix : Matrix = new Matrix() ;
                a_matrix.translate(-242,-130);
                bmd.draw(stage,a_matrix);
                
                var screenshot:Bitmap = new Bitmap(bmd);
                screenshot.x = 0;
                screenshot.y = 0;
                //var screen shot is the copied image 
              }

private function showCopiedImage():void
{
addChild(screenshot); // won’t work because it is null.
}

this is the problem i am facing, i need to seperate the copying process and showing process because i want my flash to show the copied image later on…

Seriously need help . Thanks i advance :frowning: