Jump to content
  • Advertisement
Sign in to follow this  
NoisyPerlin

[web] Flash/ASP.NET interaction

This topic is 3718 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'd like to do a game using Flash and ASP.NET (the software I'm using is Flash CS3 Professional, and Visual Studio 2005), the idea being that Flash will provide the game's interface, and ASP.NET will do the back end server side decision making. Are there any good books and resources on how to do this kind of linkage between Flash and ASP.NET? I assume that you'd have some kind of .NET webservice that Flash could talk to, but I'm not really sure if that's the way you'd do it.

Share this post


Link to post
Share on other sites
Advertisement
Flash 9 supports sockets, so you can write a normal networking app if it's fast. real-time stuff. For more traditional things, Flash supports AJAX and normal HTTP.

There are also libraries around to do such things.

Share this post


Link to post
Share on other sites
Quote:
Original post by d000hg
Flash 9 supports sockets, so you can write a normal networking app if it's fast. real-time stuff. For more traditional things, Flash supports AJAX and normal HTTP.

There are also libraries around to do such things.


It doesn't need to be fast, so I don't really need to write a networking app, I just need Flash to be able to talk to an ASP.NET back-end, preferably without posting back the whole page.

Share this post


Link to post
Share on other sites
Straightforward AJAX or other HTTP requests should be fine then.

One way is to write ASP.net pages which simply write XML rather than HTML. When you request this page using AJAX, you can then (very easily) access the returned XML as objects in Flash.

In fact, you can probably call the ASP.net page automatically using a loader of some sort to load the URL. You might even be able to do the equivalent of : var xml:XML = loader.load("somePage.aspx")

Share this post


Link to post
Share on other sites
For ActionScript 3, check the URLLoader class in the flash.net namespace. It doesn't rely on a particular data format, but XML is often preferred.

Share this post


Link to post
Share on other sites
I know you said you didn't need a persistent connection, but if you ever change your mind feel free to pick at my brain - I've made a real time avatar chat (soon to be game) using Flash CS3 and C#.Net 2.0.

I used flash's new Binary Sockets to do it.

The server processes the 'rules' and client is only used for display. I tried to code both client and server to be re-usable - so at this time the code isn't really game specific.

Otherwise, as someone else already said, AJAX would be the way to go. You can send any amount of data back and forth. A single AJAX page with an MVC type controller could handle quite a lot of different requests.

Share this post


Link to post
Share on other sites
Quote:
Original post by WanMaster
For ActionScript 3, check the URLLoader class in the flash.net namespace. It doesn't rely on a particular data format, but XML is often preferred.
Ah yes, that was the kind of thing I meant. I think there's an equivalent in the Flex/AIR API as well.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!