dkroy,As you may know you can create a custom lib in Flex/Flash Builder by going to File->New Flex Lib Project.The build action of this type of file is a SWC and this is how other projects can reuse your components.No matter what each component will have to have a "Map" property so you know about the map and can work with its properties and events. An example of this might be:
<Coordinates:Viewer MapControl="{myMap}" left="10" right="10" top="10">
</Coordinates:Viewer>
A quick sample of the code for this component would be:
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox creationComplete="creationCompleteHandler(event)"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="400"
height="58"
paddingLeft="10" paddingTop="10" paddingBottom="10" paddingRight="10" backgroundColor="#606060">
<fx:Script>
<![CDATA[
import com.esri.ags.Map;
import com.esri.ags.geometry.MapPoint;
import mx.events.FlexEvent;
import mx.events.MoveEvent;
public var MapControl:Map;
[Bindable]
public var X:Number = 0;
[Bindable]
public var Y:Number = 0;
protected function creationCompleteHandler(event:FlexEvent):void
{
this.MapControl.addEventListener(MouseEvent.MOUSE_MOVE, onMapMouseMove);
}
private function onMapMouseMove(event:MouseEvent):void{
var screenPoint:Point = new Point(event.localX, event.localY);
var mapPoint:MapPoint = this.MapControl.toMap(screenPoint);
this.X = mapPoint.x;
this.Y = mapPoint.y;
}
]]>
</fx:Script>
<s:Label text="{this.X}" id="lblX"/>
<s:Label text="{this.Y}" id="lblY"/>
</mx:VBox>
Once you have your custom component somewhat built you can add a SWC Project to a new Flex Project to test. You can add your newly created library to a new Flex Project by going to:- Right click on your test project- Select properties- Navigate to "Flex Build Path"- Select the "Library Path" tab- Choose "Add Project" and chose your new custom library Attached is a custom component library with the sample i showed above - download, unzip and then import into your workspace.Hope this helps in some way..Drew