Hi

I'm having problems removing a bitmap from the stage from within a function. Apparently I need to reference the bitmap first. How do I reference the following bitmap?

The bitmap code I'm using:
PHP Code:
function ScreenShot():void {
    
addChild(snapShot(LoadedCam)); 
    function 
snapShot(mc:DisplayObject):Bitmap {
        var 
m:Matrix = new Matrix(Flip,0,0,1,240,400);        
        var 
TempPhoto:BitmapData = new BitmapData(480,800,true,0x00000000);
        
TempPhoto.draw(LoadedCam,m);
        var 
bmp:Bitmap = new Bitmap(TempPhoto);
        return 
bmp;
    }

And the function code I'm using:
PHP Code:
function RetakeButton(event:MouseEvent):void 
    
TempPhoto.dispose();

Thanks in advance!