Check out Haxe and the library NME, which is pretty much what you describe.
except its not... :) I`m mean it suppose to be but its not
Re:Skrillex Quest
by jdonaldson on Friday November 30, 2012 @12:39PM
(#4854316)
Where does Haxe fall down for you? Not many people I know have ever looked back after using it.
I`m not talking about haxe in genereal. I have nothing against it. I`m talking about the idea of NME which is really nice but would fail in many (higher performance visuals) cases when it comes to javascript/canvas.
These days I do Objective C, but I still love AS3 & the Flash API. I just wish browsers would implement it natively (a JS version of the API), as opposed to the HTML canvas and (currently) flaky support for audio.