Thanks for the idea.
There are 22 layers in four layer groups. What I did was create a separate mxd for each group, then save each as MSD, created a service for each, then add all services to the Flex Viewer. I discovered that all but one of the msds appear in the legend. Now I know (I think) that there is a problem with one or more of the layers in that one group.