My preference is a little different from Hack Jeff
If you aren't sanding wood floors I like to paint, then do floors and trim (prepainted). When I'm done I go back and touch up all the paint/trim as the last thing. I do it that way because I am afraid I would spill paint on the new floors or carpet. (one reason) The other reason is I think its much easier and faster to paint with no trim on the walls.