Solved! Go to Solution.
// - Start modification - // [Bindable] private var mapScale:int; // - End modification - // map.addEventListener(MouseEvent.MOUSE_MOVE, map_mouseMoveHandler); // - Start modification - // map.addEventListener(MouseEvent.MOUSE_WHEEL, map_mouseMoveHandler); map.addEventListener(MouseEvent.DOUBLE_CLICK, map_mouseMoveHandler); // - end modification - // private function map_mouseMoveHandler(event:MouseEvent):void { // - Start modification - // var nf:spark.formatters.NumberFormatter = new spark.formatters.NumberFormatter const mapPoint:MapPoint = map.toMapFromStage(event.stageX, event.stageY); mapScale = Number(map.scale); coords.text = m_func(mapPoint) + " Scale 1:" + mapScale; // - end modification - // }
As EricV stated, you will need FashBuilder to modify the CoordinateWidget.mxml file to add the scale value. I use a bit more code than EricV does, because I want the scale to be an integer value and to change as the various mouse actions change. Below are three code fragments that may help. (I use comments to help me track changes and give me a place to start when the next version of a widget or Flex is released.) Hopefully this helps. (Note: the code below is for flex viewer 3.1 and FlashBuilder 4.7.[ATTACH=CONFIG]20271[/ATTACH]// - Start modification - // [Bindable] private var mapScale:int; // - End modification - // map.addEventListener(MouseEvent.MOUSE_MOVE, map_mouseMoveHandler); // - Start modification - // map.addEventListener(MouseEvent.MOUSE_WHEEL, map_mouseMoveHandler); map.addEventListener(MouseEvent.DOUBLE_CLICK, map_mouseMoveHandler); // - end modification - // private function map_mouseMoveHandler(event:MouseEvent):void { // - Start modification - // var nf:spark.formatters.NumberFormatter = new spark.formatters.NumberFormatter const mapPoint:MapPoint = map.toMapFromStage(event.stageX, event.stageY); mapScale = Number(map.scale); coords.text = m_func(mapPoint) + " Scale 1:" + mapScale; // - end modification - // }
You will need to download the source code and API for Flex. The following link will walk you through the process: http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Getting_started_for_developers/...