public function drawScaled(obj:DisplayObject, thumbWidth:Number, thumbHeight:Number):Bitmap {
var m:Matrix = new Matrix();
m.scale(thumbWidth / obj.width, thumbHeight / obj.height);
var bmp:BitmapData = new BitmapData(thumbWidth, thumbHeight, false);
bmp.draw(obj, m);
return new Bitmap(bmp);
}