I generally ignore what is legal, and go with what is safe. When riding in the city, where there are street lights, I'll go with one or two rear flashers. If I go outside the city where there are no street lights, I'll make sure that I have at least one solid light and preferably also a flasher.
As mentioned above, the solid light is useful so that people can judge your distance/location, but this is not needed on a well lit street, where there are lots of other cues to communicate distance/location, so attention-getting then becomes the primary purpose of all lights, and the flashers are better at doing that.
If I was ever pulled over by a cop who thought that my rear flasher was illegal then I would apologize for trying to be as safe as possible (maybe he'll then realize that he shouldn't pursue it any further), but I would pay the fine if it is indeed deemed to be illegal, but would afterwards continue to use the flasher, still not caring what the law says and only caring about my safety.