Trying to name that FetchFido game where you capture the other team's flag, play as an archer, and upgrade to stronger arrows and infantry? That's Defend Your Castle.
It's a well-known Flash strategy game where you fend off waves of enemies, and the archer-and-upgrades gameplay matches what you're describing. If that rings a bell, Defend Your Castle is almost certainly the title you're after.