views:

27

answers:

1

I'm working on a flash game written in pure actionscript 3.0 in Flex.

I've just finished implementing replays for the game, but want to store the top 10 hiscores' replay data on my google-app-engine'd website.

I'm using Java for the app-engine stuff in Eclipse in java but I have no idea how to deal with communicating to my java code from my actionscript code.

I'll need to both read and write from actionscript -> java -> datastore. Does anyone have any experience with this?

For note, I'm horribly noob with anything to do with web development. I hear you can pass arguments to a URL when calling it, comparable to command-line arguments on a desktop executable and if so then sending all the data as a large string would be doable...

The question then would be how to call a url from AS3 code with additional data and then how to catch that on the java side.

Thanks to anyone who can help.

Jono

A: 

hi,

you can stuff the serialized replay into URLRequest::data and send it per POST. You can also pass it as variables, creating a new URLVariables object, store that data with in it and pass it to URLRequest::data and send it either per POST or GET (the latter of which implies appending the parameters to the URL (whereas the former allows sending them in the request body)).

please note however, that there is no guarantee that GET parameters are properly supported if they exceed 2KB. also, requests using GET method should not have side effects. please see http request methods for further information.

greetz
back2dos

back2dos
Cheers back2dos, that helps on the actionscript side, but how do i go about catching the data from the java side?I assume the URL we are talking about is the path/name of the java executable stored on the GAE(Google-App-Engine)?Then we would call http://[name].appspot.com/[java exe] right? How then would I catch the data from the request in java code? Currently the only java code i have is the template HttpServlet that implements the doGet function, the same code that's generated when creating a new app-engine project.
Jonathan