Hello,
I'm using the following code to create a marker with a listener that would
populate a sidebar info panel with data specific to the marker. That was not
working so I tried a simple trace to test if the mouse click was registering
at all, and apparently it's not. I've looked through several examples on
the forum and feel that my code is set up correctly but evidence suggests
otherwise. Any ideas on how to troubleshoot this?
Thanks,
Dave
function createMarker(i:int, latlng:LatLng, fuelpct:Number, type:String,
id:String, co:String, capacity:Number, grade:String, refuel:String):void {
var myIcon:Icons = new Icons();
myIcon.gotoAndStop(type);
var tank:String;
var colorInfo:ColorTransform = myIcon.back.transform.colorTransform;
switch (true) {
case fuelpct >= 80 :
colorInfo.color = 0x009900;
tank = "full";
break;
case fuelpct >= 50 :
colorInfo.color = 0xFF9900;
tank = "half";
break;
case fuelpct < 50 :
colorInfo.color = 0xFF0000;
tank = "empty";
break;
}
myIcon.back.transform.colorTransform = colorInfo;
var options:MarkerOptions = new MarkerOptions({icon: myIcon});
var marker:Marker = new Marker(latlng, options);
marker.addEventListener(MapMouseEvent.CLICK, function(e:MapMouseEvent):void
{;
trace("marker clicked");
});
markerObjects[i] = [marker, id, type, co, capacity, grade, refuel, fuelpct,
tank];
map.addOverlay(marker);
}
--
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/-/Geka4ANGNKEJ.
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.