Here is the source code for the APE post. The latest version of haXe supports now supports as3 virtual/override, so the resulting as3 code compiles without modification. However, I have modified it for performance reasons by changing the typecasting to the native function.