Hi faki -

You can try what Florian suggested. If you still want to use the
marker dictionary, try this out.
I haven't actually tested it but in theory it works fine :)

//create your markers using a function
private function makeMarker(point:LatLng, args:Array):IMarker {
    var marker:Marker = new Marker(point);
    markerArray[marker] = args;
    marker.addEventListener(MapMouseEvent.CLICK, onMarkerClick);
    return marker;
}

//On click
private function onMarkerClick(event:MapMouseEvent):void {
    var marker:Marker = event.target as Marker;
    var args:Array = markerArray[marker] as Array;
    for each(var obj:Object in args) {
        trace(ojb.toString());
    }
}


-Arothian
On Apr 29, 2:49 pm, faki <[email protected]> wrote:
> Hi Arothian,
>
> could you elaborate a bit? I couldn't make it work - my markers were
> still only outputting the last value...
>
> var markerArray:Object = new Object();
> ....
> var marker:Marker = new Marker(latlng, markerOptions);
> marker.addEventListener(MapMouseEvent.CLICK, getInfo);
> markerArray[marker] = [someValue1, someValue2];
> ....
> function getInfo(event:MapMouseEvent):void{
>         var marker:Marker = event.target as Marker;
>         var vars:Array = markerArray[marker];
>         trace( vars[0] );
>
> }
--~--~---------~--~----~------------~-------~--~----~
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