Я за точность

Код:
import flash.geom.*;
import flash.display.BitmapData;
getTextBounds = function(txt) {
var x = txt._x;
var y = txt._y;
var w = txt._width;
var h = txt._height;
var xs = txt._xscale;
var ys = txt._yscale;
var scale = 20;
txt._xscale = xs*scale;
txt._yscale = ys*scale;
var bmp = new BitmapData(txt._width,txt._height,true,0);
var mtx = new Matrix();
mtx.scale(scale,scale);
bmp.draw(txt, mtx);
bmp.colorTransform(bmp.rectangle,new ColorTransform(1,1,1,1,0,0,0,255));
var rect = bmp.getColorBoundsRect(0xFF000000,0x00000000, false);
bmp.fillRect(rect,0x80FFFF00);
rect.x /= scale;
rect.y /= scale;
rect.width /= scale;
rect.height /= scale;
txt._xscale = xs;
txt._yscale = ys;
bmp.dispose();
return rect;
}
rect = getTextBounds(txt);
beginFill(0xFF0000, 30);
trace(rect);
moveTo(txt._x+rect.x+2,txt._y+rect.y+2);
lineTo(txt._x+rect.x+rect.width+2,txt._y+rect.y+2);
lineTo(txt._x+rect.x+rect.width+2,txt._y+rect.y+rect.height+2);
lineTo(txt._x+rect.x+2,txt._y+rect.y+rect.height+2);
endFill();