something a whole lot simpler than either, but also a lot harder to explain :P it's called haxepunk, it's a port of flashpunk which was a library built on top of as3. haxepunk is built on top of openfl, which is an open source engine built on top of haxe meant to replicate flash (while also providing a LOT of portability and performance improvements)
bored yet? :P