Hi linnrobin- If the "complete" event isn't being reached, then you should add event listeners for the other events to see what is happening. See the Events list here: http://livedocs.adobe.com/flex/201/langref/flash/net/URLLoader.html
It may also help to inspect your requests in Firebug to see what the server is responding with. - pamela On Tue, Jun 2, 2009 at 10:13 PM, linnrobin <[email protected]> wrote: > > no can't do... > the submit button just won't do anything > > public function saveData():void { > var name:String = textInputName.text; > var type:String = comboBoxType.text; > var lat:Number = marker.getLatLng().lat(); > var lng:Number = marker.getLatLng().lng(); > var urlRequest:URLRequest = new URLRequest("http://localhost/maps/ > phpsqlinfo_addrow.php"); > urlRequest.data = "name=" + name + "&type=" + type + "&lat=" + lat > + "&lng=" + lng; > urlRequest.method = URLRequestMethod.POST; > var urlLoader:URLLoader = new URLLoader(urlRequest); > > //Alert.show("test"); just works until this part > > urlLoader.addEventListener("complete", function(e:Event):void { > if (urlLoader.data.length <= 1) { > Alert.show("Successfully added!"); > marker.closeInfoWindow(); > } else { > Alert.show("There was an error adding the data :("); > } > }); > } > > any other method? > > On Jun 3, 4:07 am, pamela fox <[email protected]> wrote: >> Hi linnrobin - >> >> You should try changing $_GET to $_POST - that infowindow code sends >> the request via HTTP POST. >> >> - pamela >> >> On Tue, Jun 2, 2009 at 12:17 PM, linnrobin <[email protected]> wrote: >> >> > So, I'm using google maps API for flash with flex SDK, but I can't add >> > new data to the database >> >> > The code I'm using is: >> >> >http://gmaps-samples-flash.googlecode.com/svn/trunk/demos/InfoWindowD... >> >> > when I compile the original file, it gives me the "successfully added" >> > alert. But, If I change the source to my localhost, I never got any >> > alert, the urlLoader never send "complete" event, and the database >> > won't be updated. >> >> > I'm using this to update the data: >> >> >http://gmaps-samples.googlecode.com/svn/trunk/articles-phpsqlinfo/php... >> >> > If I use the same example as written in phpsqlinfo article here >> >> >http://code.google.com/support/bin/answer.py?answer=80201&topic=11364 >> >> > the mysql will be updated with new data. >> >> > I've seen that pamela >> > usedhttp://imagine-it.org/mashplanet/phpsqlflex_addrow.php >> >> > my guess is I need to change something here: >> >> > // Gets data from URL parameters >> > $name = $_GET['name']; >> > $address = $_GET['address']; >> > $lat = $_GET['lat']; >> > $lng = $_GET['lng']; >> > $type = $_GET['type']; >> >> > but, the question is, what do I need to change? >> >> > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
