(Reuters) - The U.S. military needed a better way to kill flies on the battlefield and researchers think they found it: use blue.

Pesky common houseflies prefer a deep blue with pinstripes over the bright yellow hue traditionally used in flytraps, according to University of Florida research released on Wednesday.

The finding led researchers to create the Florida Fly-Baiter, a blue-striped trap that killed more than 40,000 flies in a one-month test with a 96 percent success rate, according to Phil Koehler, a professor of urban entomology.

Funded by the U.S. Department of Defense's Deployed War-Fighter Protection program, the trap was designed to help soldiers combat flies that swarm and spread disease in the aftermath of battle when infrastructure breaks down.

"You can't talk to someone because the buzzing is so bad and you can't open up your mouth because a fly will fly in," Koehler said.

Koehler said the Fly-Baiter also will be available within the year to humanitarian organizations in regions hit by natural disasters, and to the general public swatting the errant fly at the dinner table.

Key to the device were behavioral tests and electro-retinograms, which charted electrical activity in the retina to determine the flies' color preference. In one test, flies were placed in a tunnel with blue and yellow end pieces.

"They chose blue 4-to-1 over yellow which in a political election would be a landslide," Koehler said.

Further research showed the flies were even more attracted by blue with skinny black lines, which apparently look to the flies like crevices on the outside of buildings where the insects make their entrance, Koehler said.

The Fly-Baiter works by attracting flies from far away with the new color palette. They also are lured to poisoned bait by a substance that includes protein and sweet and sexually enticing compounds. Koehler said most flies drop dead instantly.

After discovering a successful combination, Koehler said he asked a trap manufacturer why his traps were yellow.

"He said they've always been that color. Nobody knows why," Koehler said.

Until the Fly-Baiter, Koehler said aerial spraying was the typical option to combat swarms of flies.

"If you were standing there when they sprayed, they were falling like rain and you could hold out your hand and fill it with flies," he said. Koehler said the device has been tested in Iraq, Afghanistan, and Greece. It will be the first product funded by the military's Deployed War-fighter Program to go into production.

The Fly-Baiter already proved its worth at one military outpost in Egypt when one of the researchers, who also is a soldier, deployed with a prototype. Koehler said the soldier-researcher's superior officer awarded him a medal for ridding the camp of the pests.

He estimated the wholesale cost at about $10, not including the bait.