This is only the case if no one who gets money, either directly or indirectly, from Wal-Mart wants to buy any of the stuff your local economy was making. Think of all the people all around the world who get money from Wal-Mart. If none of these people want to buy anything you and your fellow townsmen make, then you are absolutely right that the money leaves your local economy forever.
But this points to a deeper pathology. You want something people outside your community provide (through Wal-Mart or whatever), but you refuse to give back an equal amount of value for what you extract. Because of this expectation, you rail against anything non-local. This is how trade deficits get started, and the solution to them is not to scream for a reemergence of isolationist economic policy, which is essentially your concept of a self-circulating local economy. The solution is to realize that other people want you to do things for them when they do things for you, and to get over this quaint notion of historic mainstreet town life if you really want the things that a big box style economy provides. You can't have both unless you want to go broke.
I also think local merchants are more likely to sell goods/services that are better for their local economy than a big box retailer that is completely disconnected from the local economy.
Can you back this up, or are you waxing sentimental?
As far as the flow of capital is concerned, a big box retailer provides a lot for a local economy because people spend a lot of money there. They're winning as far as cash flow goes, which means they are giving people what they want, even if they whine about getting it.
If nothing else, I think this shows that local economies aren't as special and unique as people claim they are; it's like the Lake Wobegon Effect for retail. Your local economy is not that special, your locality is not that special, and your fight to remain isolated in all the ways you think matter while becoming interconnected with other communities in all the ways you are willing to tolerate is going to backfire, because you come across expecting more from others than they are allowed to expect from you. If you want that money back, then do something that makes people want to give it back to you. It's as simple as that.