Select to view content in your preferred language

Track a Point Dynamically

590
1
08-26-2010 11:52 AM
JasonLin
Emerging Contributor
I was using a swfloader to display a hover effect on a graphic. I later realize the swf stays at the same screen location when zooming or panning around. I know my logic is flawed but I'm not sure exactly how to fix it. Can someone suggest a good way to keep track of graphic location so that swf's position is updated accordingly?

Thanks,

myGraphic.addEventListener(MouseEvent.MOUSE_OVER, hoverHandler);

private function hoverHanlder(event:MouseEvent):void
{
 var pt:Point = map.toScreen(event.currentTarget.geometry as MapPoint);
 mySwf.visible = true;
 mySwf.x = pt.x;
 mySwf.y = pt.y;
}
Tags (2)
0 Kudos
1 Reply
DasaPaddock
Esri Regular Contributor
Try just changing the graphic's symbol to a PictureMarkerSymbol whose source points to your swf when you mouse over the graphic and change it back when you mouse out.

Reference:
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/symbols/PictureMarkerSymbol.html
0 Kudos