views:

230

answers:

3

Hi All,

I am a .NET programmer working with a Flash designer on a project. The design is that they will create a flash UI (implemented with AS2) to present a questionnaire. After it is completed by an end user, the will send me (a .net web service of some form) the answers to the questionnaire, I will perform a calculation, and I will send a response back (the response will likely be a single integer, though it may be a touple of (integer score, string description).

Neither myself nor the designer is knowledgeable of Action Script. Does anyone have a snippet for such web service calls in AS2? Are there any soap libraries for AS2 that we could use, or should I expose a RESTful interface? Can it be as simple as having the designer concat the questionnaire answers into the query string of the service URL? What would be a typical data format for my response (xml, json, plain text)

Thanks in advance for your help.

Frank

A: 

Unless you need advanced features of SOAP based web services I would definitely recommend going to REST route for web services called from the browser, be it javascript or actionscript.

.NET will automatically create JSON responses for you from plain objects.

James Westgate
A: 

I'd probably go with AMF. It's built in to Flash so you get serialization automatically. I'm pretty sure there's an AMF lib for .NET as well. If you're using AS2, make sure you get AMF0, not AMF3.

Check the wiki page for more info on AMF. Most of the AMF language libraries have examples of how to implement the language specific portion of the AMF communication as well as examples of how to implement it in Flash. You should be able to get the code snippets you need that way.

Alex Jillard
A: 

I have used loadVariables and sendAndLoad method in one of my projects.

Look at the link below: Sample

The above code will help you to pass the value from your flash app to .NET page.

Now to send the data back from C# page to Flash , you need to write the result in another page using response.write.(the page should write something like myText1=resultFromC#;

Now load that page to flash , using loadVars , I don not have the flash sample now. Try with this else I will update it soon.

But if your are trying to use webService connector in Flash m not sure how far that will help.

Subhen