Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I know this may be a somewhat dumb idea, but is there any "easy" resource that anyone can point me towards that shows how to set up a simple LAN connection in an Actionscript application? I only need to have two clients connected. Nothing extremely robust.

This is not an AIR application. It's for a game idea that I have that will need two players essentially. It will be local, so having each other's IP addresses will be an option. So no need to find or detect any IP addresses.

Thanks.

share|improve this question
2  
You should try to add more details to your question. Is this an AIR application? Do you know the IP addresses of the clients or do they have to find themselves in the network? Also what do you use the connection for? –  bummzack Feb 22 '12 at 8:17
    
Sorry. Will add those edits. –  Nicholas Feb 22 '12 at 8:58

2 Answers 2

up vote 4 down vote accepted

You can't establish a direct connection between two flash-applications. You could write a server (for example in JAVA) which both flash clients connect to by using XMLSocket.

You can also do all your coding in Actionscript, but for that at least one of your applications needs to be an AIR application. There you can use ServerSocket and use Socket to connect with a client to the server.

So the simplest approach would be to write your Game as an AIR Application. Then you start one as the "server" (establish a ServerSocket) and connect from the other application to the IP address of the server.

Update: Here's an article that will guide you through the basics of ServerSocket and Socket.

share|improve this answer
    
This is an old answer but I think it's wrong: NetConnection and NetGroup can be used for p2p communication between 2 flash apps (no need for air). I've corrected @Dovyski links, I think his answer is the most relevant. –  Chadyk Oct 31 '13 at 21:12

You can embed an socket server in your game or create a side application that you will use as server. It is fairly simple to do with AIR: http://www.adobe.com/devnet/air/flex/articles/creating_socket_server.html

another option is to use p2p connection with flash using cirrus: http://labs.adobe.com/technologies/cirrus/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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