Do you have two separt map controls in the flex application? If so, one method is to loop through each layer in map 1 and add the layers one by one to map 2. I do this for a print preview. Something like...
private function cloneMap():void
{
layerCount = 0;
for (var i:Number = 0; i < map1.layerIds.length; i++)
{
var layer:Layer = map1.getLayer(map.layerIds);
if (layer is ArcGISDynamicMapServiceLayer)
{
layerCount = layerCount + 1;
var dynamicLayer:ArcGISDynamicMapServiceLayer = layer as ArcGISDynamicMapServiceLayer;
var newdl:ArcGISDynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer(url, proxyurl, token);
newdl.proxyURL = dynamicLayer.proxyURL;
newdl.token = dynamicLayer.token;
newdl.alpha = dynamicLayer.alpha;
newdl.visible = dynamicLayer.visible;
newdl.visibleLayers = dynamicLayer.visibleLayers;// visiblelyrs;
newdl.layerDefinitions = dynamicLayer.layerDefinitions;
newdl.name = dynamicLayer.name;
newdl.addEventListener(LayerEvent.LOAD, layerLoadComplete);
map2.addLayer(newdl);
}
//... you need to handle all layer types individually, and figure out what you need to transfer.
}
Chris