Honestly I would avoid action script. I know some use it for rapid prototyping but flash is on its way out. Better to learn and use something with a bit more long term value. Unity is great, so is UDK. I would like to note as well that the guys who made Torchlight used Ogre3d (free) for its rendering engine.
If you need your game to be as open-source and budget-friendly as possible, I would advise developing it in Actionscript 3.0 with the Starling framework. You should be able to use AIR for cross-platform support. This route will allow for nearly-free development without any licensing fees. The access to the full source code…