Restrict Decimal Places for Textfields - From https://supportforums.blackberry.com/t5/Adobe-AIR-Development/textField-restrict-how-to-just-allow-one-decimal/td-p/696319
function restrictDecimalPlaces(evt:TextEvent):void
{
var matches:Array = evt.currentTarget.text.match(/\./g);
var allowedDecimalPlaces:uint = 2;
if ((evt.text == "." && matches.length >= 1) ||
(matches.length == 1 && (evt.currentTarget.text.lastIndexOf(".") + allowedDecimalPlaces < evt.currentTarget.text.length)))
evt.preventDefault();
}