Came back to this one a few times cause I wasn't understanding the problem with it being asynchronous but I think I get what you're saying now so you have a listener that handles the geocoding results but you fire to geocode a whole group of things at one time rather than sending them one by one. So the problem is you're loop is calling geocode many times and you're getting results back out of order and probably trying to associate them with you're posto variable or something like that... what I'm thinking you need to do is have a counter that is at the class level so it is in scope between the result handler and the method you have here that does the geocoder.geocode then increment the counter each time the handler gets hit and make a call to this method (or a new one, you may need to separate out this functionality) so essentially you're adding some synchronization to something that is asychronous normally, this way you're order is maintained because you request one you get one back you move on to requesting the next one so you will never request the next one before the current one is processed. Hopefully some of this makes sense, or else I may be completely misinterpreting you're problem, if so and its still an issue please explain more throughly or post more code (for example I don't know what returnedColl is I'm assuming it's you're data from the database but it took some effort to figure this out... in short I'm lazy explain more and I can think less :). Good luck, Shaun
On Sep 22, 4:04 pm, Marcelovs <[email protected]> wrote: > Hi people, > I have a problem. > > I'm develloping an application that contains many addresses in my > database and I need to search this addresses in google maps. > I'm sure the addresses are right, because when I search one by one, > The google map finds it, but when I search many addresses they doesn't > work correctly. > I know this method - ClientGeocode.geocode - is asynchronous this > situation occurs because of this, but I don't know how to solve it. > > It's part of my code: > > googleMap.clearOverlays(); > > var returnedColl:ArrayCollection = ArrayCollection > (event.message.body); > > var lObject:PostoVO = null; > for(var i: int; i< returnedColl.length; i++){ > lObject = PostoVO(returnedColl[i]); > geocoder.geocode(lPosto.address); > } --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
