The best way would be to use a temporary (static, reusable) transparent BitmapData for this operation. You fill it with 0x0, then call threshold()
setting source to your BitmapData, and copySource
flag set to false, then you copyPixels()
back with mergeAlpha
set to false.
var tbd:BitmapData=yourBitmapData.clone(); // this makes a new BitmapData, so be warned
var p0:Point=new Point();
tbd.fillRect(tbd.rect,0);
tbd.threshold(yourBitmapData,yourBitmapData.rect,p0,yourOperation,
yourThreshold,yourColor,yourMask,false);
yourBitmapData.copyPixels(tbd,tbd.rect,p0);
tbd.dispose();