I've used Scaleform a good amount. It's not 100% compatible with stock Flash but it's pretty darn close in the use cases I've been exposed to.
Scaleform has a complex code base but clearly it is possible to reverse engineer the Flash runtime and make a compatible player.