2

I have a Drupal site which will host a flash application. The application will be inserted in a node body (or as an attachment, not sure yet). I would like this application to send some data to Drupal (e.g. a game progress and score) using Javascript.

What I achieved so far is the ability to have the game score displayed in a Javascript alert window in Json format. Next step would be to send it to Drupal and I want to save it to a table. I don't know how to do the "Send it to Drupal" part. What is the right way to do it, so it's hacker-proof etc?

3
  • Did you consider not using JavaScript? With JavaScript, the communication would be ActionScript to JavaScript, and JavaScript to server. There are many way to implement a direct communication between ActionScript and the server, considering there are XML-RPC clients for ActionScript, and Drupal implements a XML-RPC server by default, without any extra modules being installed.
    – apaderno
    Oct 15 '12 at 13:52
  • As far as I know it must be Javascript, not ActionScript. I'll check all the answers, it may take me a while, thanks.
    – camcam
    Oct 15 '12 at 14:02
  • 1
    ActionScript is the scripting language used in Macromedia Flash.
    – apaderno
    Oct 15 '12 at 14:03
0

If you do it the JS part, Drupal part will be quite easy.

Create module with form that handle data transfer to Drupal and submit this form via Ajax https://drupal.org/node/752056

It can be helpful too: Match JSON POST data with custom node fields

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.