Simulating Gravitational Forces in AS3

So, I may have bitten off a bit more than I could chew in this post, but it is something that has been an intriguing thought to me for some time: how can I simulate the effect, or pull, of gravitational forces between different objects on my stage? Obviously, if you read my previous post, you know that I have had some fascination with orbits and circular motions, but I am much more interested in paths that appear to be natural — almost evolving, if you will.

This got me to contemplating that, in our universe, every object acts upon every other in some way: keeping our planets in orbit around the sun while helping each other to retain their individual satellites and keep from hurtling into outer space. Embodying the interactions of the various bodies on one another and trying to come up with a simple enough algorithm that will simulate a fluid motion while not overloading the Flash player with unnecessary overhead was my goal. I have some work yet to do, but I thought I would at least share my concepts with you and see what improvements can be made whilst still keeping things lightweight.
Continue reading