BitmapData.draw()

I have googeled, read the manuals but still don’t get it.

I need proper example of how you draw some specific portion of the MovieClip into BitmapData.
I give function x:int, y:int, width:int, height:int parameters and it will return me BitmapData. Problem for me in this case is that i don’t know how you position the clipping rectangle so that you could get little part from the middle of the MovieClip.

I have written this code:

public function getBitmapData(x:int, y:int, width:int, height:int):Bitmap{
var cutArea:Rectangle = new Rectangle(x,y,width,height);
var bitmapMapData = new BitmapData(width,height);
bitmapMapData.draw(mapMC,null,null,null,cutArea);
var bitmapMap = new Bitmap(bitmapMapData);
return bitmapMap;
}

where mapMC is movieClip. This function does not give me exact result what i expect but i guess people who have done it know what is the problem.

Thanks in advance!