The simple answer is to give the layer (either an ArcGISDynamicMapServiceLayer, ArcGISImageMapServiceLayer, or ArcGISTiledMapServiceLayer) a new URL endpoint (making sure that the URL points to a matching type of map service layer) and refreshing the layer.
If you're asking about the Flex Viewer specifically, I'm not using it so I can't readily answer that question, but I'm sure somebody's asked that question already. You might want to try the Flex Viewer forum.