0

I'm experiencing the popular Security Sandbox violation...

I use Google Maps Flex API and now i want to access the Google Geocoding API . For this , i use the HTTPService :

<s:HTTPService id="geo_req" url="http://maps.googleapis.com/maps/api/geocode/xml?address={i_address}" result="geo_req_resultHandler(event)" />

But i got Sandbox Security violation . So i've created crossdomain.xml as :

<cross-domain-policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="http://www.adobe.com/xml/schemas/PolicyFile.xsd">
<allow-access-from domain="*" secure="false" />
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy> 

I use WAMP server and can access the file by typing http://localhost/crossdomain.xml ... Still i can't access the url.

How can i get rid of this ?

vettipayyan
  • 3,150
  • 3
  • 25
  • 34

2 Answers2

0

You need to put the CrossDomain.xml file on the domain you're sending the request to.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
0

why don't you use the existing class ClientGeoCoder to geocode your address, instead of making an HTTP request to the Google site?

Do you successfully run the example on this link: http://code.google.com/p/gmaps-samples-flash/source/browse/trunk/samplecode/GeocodingSimple.mxml ?

Harry Ninh
  • 16,288
  • 5
  • 60
  • 54
  • i did . I have already been using ClientGeocoder . We can get the address details from it , but my requirement is 'location_type' . I can't get it from Placemark. If you know that , can u plz post it here .... – vettipayyan Jun 20 '11 at 18:27
  • Hmm, I think you cannot use the common Geocoding API for flash due to security issue (because you can't put your own crossdomain.xml file to Google server definitely). If you can't get the location_type from ClientGeocoder, think about requesting it via JavaScript and feed back to Flash – Harry Ninh Jun 21 '11 at 06:03
  • ya ya . That's what i am trying now . But Flash Developer deletes the inserted code every-time while running the application . ( Whoof , i really got tired .... ) – vettipayyan Jun 21 '11 at 10:59