Daniel, Cedric's code for adding an event listener for the extent change is exactly what you need. The only thing I would do is also remove the event listener when it is not needed as shown below, no need to continue to listen for the extent when the widget is closed or minimized (you have to always consider code performance/optimization). Also there is no real need for a config xml for this simple widget so eliminate the widgetConfigLoaded and use creationComplete.<?xml version="1.0" encoding="utf-8"?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// Display the extent URL for the user
//
////////////////////////////////////////////////////////////////////////////////
-->
<BaseWidget xmlns ="com.esri.solutions.flexviewer.*"
xmlns:mx ="http://www.adobe.com/2006/mxml"
x ="600"
y ="220"
creationComplete ="init()">
<mx:Script>
<![CDATA[
import com.esri.ags.events.ExtentEvent;
import com.esri.ags.Map;
private function init():void
{
map.addEventListener(ExtentEvent.EXTENT_CHANGE, repositionInfo);
txtVersion.text = "https://server.com/flex/index.html?EXT=" + String(map.extent.xmin) + "," + String(map.extent.ymin) + "," + String(map.extent.xmax) + "," + String(map.extent.ymax);
}
private function widgetOpenedHandler(event:Event):void
{
map.removeEventListener(ExtentEvent.EXTENT_CHANGE, repositionInfo);
map.addEventListener(ExtentEvent.EXTENT_CHANGE, repositionInfo);
txtVersion.text = "https://server.com/flex/index.html?EXT=" + String(map.extent.xmin) + "," + String(map.extent.ymin) + "," + String(map.extent.xmax) + "," + String(map.extent.ymax);
}
private function repositionInfo(event:Event):void
{
txtVersion.text = "https://server.com/flex/index.html?EXT=" + String(map.extent.xmin) + "," + String(map.extent.ymin) + "," + String(map.extent.xmax) + "," + String(map.extent.ymax);
}
private function widgetClosedHandler(event:Event):void
{
map.removeEventListener(ExtentEvent.EXTENT_CHANGE, repositionInfo);
}
]]>
</mx:Script>
<WidgetTemplate widgetOpened="widgetOpenedHandler(event)" widgetClosed="widgetClosedHandler(event)"
widgetMinimized="widgetClosedHandler(event)">
<mx:Canvas id="viewStack" width="100%" height="100%" horizontalScrollPolicy="off">
<mx:VBox width="100%" paddingTop="15">
<mx:Text id="txtTitle" styleName="AboutTitle" text="URL for copying" width="100%" />
<mx:Text id="txtSubtitle" styleName="AboutSubtitle" text="You can highlight and right-click (or CTRL-C) to copy the URL:" width="100%" />
<mx:Text id="txtVersion" styleName="AboutVersion" text="" width="100%" />
</mx:VBox>
</mx:Canvas>
</WidgetTemplate>
</BaseWidget>