Here's what finally worked. I need to use "%26" for the ampersand, not "&" or "&". Always something isnt it! 😄So basically this brings up an Outlook message with the url of the map center and scale. Thanks a TON Robert!<?xml version="1.0" encoding="utf-8"?>
<viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:viewer="com.esri.viewer.*">
<fx:Script>
<![CDATA[
import com.esri.ags.geometry.MapPoint;
import com.esri.ags.utils.WebMercatorUtil;
import mx.controls.Alert;
private function mailme():void
{
var currentCenter:MapPoint = (map.extent.center) as MapPoint;
var u:URLRequest=new URLRequest
("mailto:someone@gmail.com?subject=Map Link&body=http://gis.co.wood.wi.us/Flex24/index.html?center="
+ myDegreeFormatter.format(currentCenter.x)
+ ","
+ myDegreeFormatter.format(currentCenter.y)
+ "%26"
+ "scale="
+ Math.round(map.scale))
navigateToURL(u,"_self");
}
private function getURLParameters():Object
{
var result:URLVariables = new URLVariables();
try
{
if (ExternalInterface.available)
{
// Use JavaScript to get the search string from the current browser location.
// Use substring() to remove leading '?'.
// See http://livedocs.adobe.com/flex/3/langref/flash/external/ExternalInterface.html
var search:String = ExternalInterface.call("location.search.substring", 1);
if (search && search.length > 0)
{
result.decode(search);
}
}
}
catch (error:Error)
{
Alert.show(error.toString());
}
return result;
}
private function setMapLocation():void
{
var params:Object = getURLParameters();
if (params["ll"])
{
var latlong:Array = String(params.ll).split(",");
if (latlong.length == 2)
{
map.centerAt(new MapPoint(latlong[1], latlong[0]));
}
}
if (params["scale"])
{
map.scale = params.scale;
}
}
]]>
</fx:Script>
<fx:Declarations>
<mx:NumberFormatter id="myDegreeFormatter"
precision="0"
useThousandsSeparator="false"/>
</fx:Declarations>
<viewer:WidgetTemplate id="passURL" widgetTitle="Pass URL" width="200" height="100">
<s:HGroup id="groupURL">
<s:Button click="mailme()"
fontSize="14"
fontWeight="bold"
label="Email Map Link"/>
</s:HGroup>
</viewer:WidgetTemplate>
</viewer:BaseWidget>