function disableAntialiasing(tf:TextField):void { var sp:Sprite = new Sprite(); var p:DisplayObjectContainer = tf.parent; var index:uint = p.getChildIndex(tf); var tfx:int = Math.round(tf.x); var tfy:int = Math.round(tf.y); var w:uint = tf.width; var h:uint = tf.height; p.removeChild(tf); sp.addChild(tf); tf.x = 0; tf.y = 0; var bmp:BitmapData = new BitmapData(w,h,true,0); var mtx:Matrix = new Matrix(); var currentX:uint = 0; var currentY:uint = 0; bmp.draw(sp); label1: while (currentY < h) { currentX = 0; label2: while (currentX < w) { var pixel:uint = (bmp.getPixel32(currentX,currentY) >> 24 & 0xFF); if (pixel > 0 && pixel < 0xFF) { break label1; break label2; } currentX++; } currentY++; } while (pixel > 0 && pixel < 255 && tf.x < 1 && tf.x >= 0) { bmp.fillRect(bmp.rect, 0); tf.x += pixel > 0x80 ? -0.1 : 0.1; bmp.draw(sp); pixel = (bmp.getPixel32(currentX,currentY) >> 24 & 0xFF); } sp.removeChild(tf); tf.x = tfx+tf.x; tf.y = tfy; p.addChildAt(tf,index); } disableAntialiasing(txt);