I believe Haxe was made to replace flash. Not sure why it isn't more popular, but it has a lot of folks from the game community that use it.
This was ~10 years ago, I'm sure the current state of the ecosystem is very different (no idea), but this is the reason why I was never able to adopt it, and I heard the same thing from dozens of Flash creators at the time.