The MOUSE_UP event is always fired, but it appears as though you have an invalid listener. From your code my guess is that you call your iniMarkers() function from somewhere, which you intend to assing the downsHandler function to your MOUSE_DOWN events. However, there appears to be no function named downHandler. In addition your MOUSE_UP event handlers are not being called. The event is still fired, but nothing is listening according to the code supplied.
Also, the MarkerOptions class supports an property for dragging of markers. This may help you even better. http://code.google.com/apis/maps/documentation/flash/reference.html#MarkerOptions.draggable var marker:Marker = new Marker(new LatLng(48,-111), new MarkerOptions({ label: "Draggable Marker", draggable: true})); this.map.addOverlay(marker); Good Luck! On Dec 30, 6:03 am, GriGri <[email protected]> wrote: > I have a problem with MapMouseEvent. > My main goal is to click a marker & drag it to a new position on the > map. I want to stop the drag on MapMouseEvent.MOUSE_UP, but this > doesn't work. I've tried adding the mouse_up listener to both the > marker as the map, with no success. > Here's a snippet from my code: > > private var currentMarker; > > private function initMarkers():void{ > myMarker.addEventListener(MapMouseEvent.MOUSE_DOWN,downHandler)} > > private function editHandlerDown(e:MapMouseEvent):void { > currMarker = = e.target; > map.addEventListener(MapMouseEvent.MOUSE_UP,upHandler); > map.addEventListener(MapMouseEvent.MOUSE_MOVE,moveHandler);} > > private function moveHandler(e:MapMouseEvent):void { > currMarker.setLatLng(e.latLng);} > > private function upHandler(e:MapMouseEvent):void { > map.removeEventListener(MapMouseEvent.MOUSE_UP,upHandler) > map.removeEventListener(MapMouseEvent.MOUSE_MOVE,moveHandler) > > } > > I guess the MOUSE_UP event isn't fired because the marker sits in the > way for detecting the event on the map. > Adding the listener to the marker doesn't work either. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API For Flash" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-maps-api-for-flash?hl=en -~----------~----~----~----~------~----~------~--~---
