Roll-your-own solution for metric collection in AS3