0
votes

I wrote a web service using Google Apps Script (GAS), using the doPost method.

Next I tried to use the service in Javascript - and everything went fine. Web service worked perfect - it wrote data to Google Sheet, read data from it and returned it back to the Javasript caller.

Now I want to call this web service from inside Flash embedded in HTML. But due to Flash security model it is impossible as in case of Javascript. There is no possibility to put the crossdomain.xml file in the GAS root domain (as I know - maybe I'm wrong?).

So my question is: does anybody know a simple method to call by Flash a web service offered by GAs?

I've got 2 solutions in my mind:

  1. Have a proxy (in PHP for example) which translates requests and responds to and from Flash
  2. Communicate with GAS web service in Javascript and communicate with Javascript from Flash using flash.external.ExternalInterface

Both solutions are rather complicated, therefore I repeat my question: is there any simple solution to allow Flash object communicate with Google Apps Script and be in line with crossdomain contrains?

Regards, Peter

1

1 Answers

0
votes

I have used pyamf to talk to Google App Engine (GAE). GAE may somehow be connected to the GAW web service.

I don't know how much data you are sending, but I like using your second option of communicating via ExternalInterface. Call a javascript function via ExternalInterface. When the javascript has the data, it sets a boolean variable to true. Flash polls for that variable by calling another javascript function that returns the value of the boolean variable, and when it sees that it is true, then it calls a function via ExternalInterface to get the data.

I have seen Google API's that eliminate the need for polling. This may be one: When is it better to use polling instead of the channel api?