OO approaches are more robust unless you're changing back and forth
between a serialized format (ie. XML).  You appear to be doing a one
off load from XML, but then working enirely in AS, so try to stick to
working with objects rather than looking up by string identifiers.

in event handler:

for each (var item:Object in gridBlocks) {
   if (item.polygon == clickedBlock) {

     //do whatever you want to do with the value
     Alert.show("You clicked on " + item.label);


     //break out of the loop, so that you don't keep searching when
you've found your result.
     break;

   }
}



On Aug 5, 8:33 am, Martin Roberts <[email protected]>
wrote:
> Thank you for the reply Ian... greatly appreciated.
>
> I have the color changing based on click on and off sorted :)
>
> I am a bit new to as3 and now jumping into gmaps too lol.
>
> Not sure how i should write that loop. If you could help I
> would appreciated it... sorry im still a bit new in the world of programming
> but very eager to learn :)
>
> I also tried something else if it might help... I have set an id property in
> the polygon options
>
> new PolygonOptions({
> id:"Block" + i,
> //accessibilityDescription:i,
> strokeStyle: new StrokeStyle({
> color: 0x00FFFF,
> thickness: 1,
> alpha: 1}),
>         fillStyle: new FillStyle({
> color: 0x666666,
> alpha: 0.7})
>
> }));
>
> and I don't get any errors but still cant seem to get the correct syntax
> to reference it with
>
> gridBlock.addEventListener(MapMouseEvent.CLICK, function(e:Event):void
> {
> var clickedBlock = e.currentTarget.PolygonOptions(id);
> check1.text = clickedBlock;
>
>
>
>
>
>
>
> });

-- 
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