Hi,
Your eventListner is a MouseEvent?
if so, you can get the currentTarget to know what block was clicked...
for example:
block.addEventListner(MouseEvent.CLICK, doSomething);
private function doSomething(e:MouseEvent) {
var clickedBlock = e.currentTarget as Overlay;
}
Look, you can extend your Overlay to have any object that you need.
for example:
private function doSomething(e:MouseEvent) {
var clickedBlock = e.currentTarget as CustomOverlay;
var obj:Object = clickedBlock.anyCustomObject;
}
Best Regards,
Thiago
i don't know if it's the solution.
2011/8/4 Martin Roberts <[email protected]>
> Hi guys
>
> Hope someone can steer me in the right direction here.
>
> Basically I want to create a dynamic grid with polygon overlays. I add
> the overlays to the map with a for loop and cascading them based on lat
> longs im pulling from an xml sheet. So far so good no hassles,
>
> My problem is that each grid block must have an event listener and I am
> creating up to 300 grid blocks at a time. Now all these blocks needs an
> eventhandeler and short of manually coding all the event handlers I cant
> come up with a solution. There must be a better way of doing this.
>
> Im fairly new to programming and is in the deep end here. Im using Flash
> Builder 4 and using the google flash API.
>
> Please please if any one can help with this or have a code snippet of
> something close to what I need I would be very great-full...
>
> Thank you
> Martin
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps API For Flash" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-maps-api-for-flash/-/SIxjexmZYDcJ.
> 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.
>
--
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.