I just posted something on my website that was built in Flash and randomly regenerates. I've been talking about this quite a bit lately, so here's an example of the principles in action. Theres still some tweaking to do, but I'm pretty happy with it. Click SPACEBAR to regenerate. Click on some of the objects to move around and SHIFT+CLICK to delete objects.