The other thing you can do is this (in your OverlayBase derived
class):

protected function initEvents():void
{
        addEventListener(MouseEvent.MOUSE_DOWN, doMouseDown);
}

protected function doMouseDown(evt:MouseEvent):void
{
        evt.stopImmediatePropagation();

        // add your code here..
}

This will stop the Map itself from receiving the event, and it has no
side effect.

Martin

On Jun 11, 2:58 pm, David Wilson <[email protected]>
wrote:
> good idea pamela, something we may fall back to if matt's dosnt work
> out in the long run.
>
> Ive tested matt's idea, and the MAP_MOUSE_ROLLOUT / IN events do not
> fire, but the standard MOUSE ROLL events seem to fire ok, so i can use
> this, like mat said, to remove the map listener when the mouse is over
> the overlay. and put it back after.
>
> thanks for your help!
>
> -David.
>
> On Jun 6, 2:38 pm, matt <[email protected]> wrote:
>
>
>
> > I'm not sure if you are getting the MAP_MOUSE_ROLLOVER/
> > MAP_MOUSE_ROLLOUT events fired for your custom overlay.  If you are,
> > one technique you could try is to desubscribe (removeListener) to the
> > MAP_MOUSE_CLICK in the rollover and resubscribe (addListener) in the
> > rollout.  This would have the effect of preventing a click event
> > coming from the map when you are on top of one of your overlays.
>
> > -matt
>
> > On Jun 5, 9:45 pm, "pamela (Google Employee)" <[email protected]>
> > wrote:
>
> > > Hey David-
>
> > > I don't think we have an API solution for you, but I could help with a
> > > workaround. How is your Overlay shaped? Could you simply use math to
> > > determine whether the click was on the tiles or on an overlay? You
> > > could have an array of all your overlays, then for each click, iterate
> > > through the overlays and check to see if the clicked point was inside
> > > the overlay. You can do a point-in-poly calculation or
> > > point-in-bounds. That might be safer than relying on order of click
> > > events.
>
> > > What do you think, could that work?
>
> > > - pamela
>
> > > On Wed, Jun 3, 2009 at 7:26 AM, David
>
> > > Wilson<[email protected]> wrote:
>
> > > > any update on this?
>
> > > > thanks!
>
> > > > On May 25, 5:09 pm, pamela fox <[email protected]> wrote:
> > > >> Hi David-
>
> > > >> Thanks for posting. I'll chat with the team to see how to best achieve
> > > >> your desired functionality.
>
> > > >> - pamela
>
> > > >> On Sat, May 23, 2009 at 9:59 AM, David Wilson
>
> > > >> <[email protected]> wrote:
>
> > > >> > I think ive run into this issue here:
>
> > > >> >http://code.google.com/p/gmaps-api-issues/issues/detail?id=855
>
> > > >> > If you click on a custom overlay extended from overlay base, a
> > > >> > MapMouseEvent.CLICK event is fired from the map, but not the overlay
> > > >> > itself. In the map event there is no info to identify the overlay.
>
> > > >> > What i need to do is to be able to select a custom overlay, then
> > > >> > deselect it by clicking the map. I can achieve this by putting a 
> > > >> > flash
> > > >> > Mouse.CLICK event on the overlay. But the MapMouseEvent.CLICK event
> > > >> > still fires (as expected) on the map. As i have to use this event to
> > > >> > deselect everything i end up with both events firing, the order of 
> > > >> > the
> > > >> > events means things getting deselected then selected, which is ok, 
> > > >> > but
> > > >> > not ideal.
>
> > > >> > is it just luck that this event ordering is happening, or is that
> > > >> > fixed?
>
> > > >> > Is there a way i can put a click handler on to the map that does not
> > > >> > trigger the same as the MapMouseEvent.CLICK event. such as on the
> > > >> > tiles themselves for the deselect?
>
> > > >> > or just have an event on the overlay that does not trigger the
> > > >> > MapMouseEvent.CLICK event on the map?
>
> > > >> > This behaviour does not happen with a marker, as only the
> > > >> > MapMouseEvent.CLICK event is fired on the marker, not the map as 
> > > >> > well;
> > > >> > but i need to use the overlay base for what the overlay needs to do.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to