Connect Flash & Unity through an socket connection

I working a lot with computer vision & augmented reality technologies. I'm trying to connect an flash (video processing) application with Unity through an socket.

There is any way to do this in indie + web version?

According to the Unity license comparison sheet, Unity (free), Unity pro, and iPhone Advanced have access to .NET sockets.

Use .NET sockets to connect with virtually any back-end technology you want to create network-aware content that offers a dynamic and ever-changing game play experience. .NET socket libraries can be used for real-time networking, by opening TCP/IP sockets or sending UDP messages. They also make speaking XML easy, and can connect to ODBC database connections.

With flash, you can't use UDP, so you'll have to set up TCP socket connections.

It is possible and it does work, still awaiting user feedback but and embryonic demo can be found at the link below, what you must do is respond when flash asks for a policy file through the port it opens, reply with the policy and away you go, hope this helps.

flash unity cam at

I'm looking into this possibility too and found some worrying details about sockets in the actionscript livedocs.

Especially the second restriction sounds like it could prevent a flash control and a unity control in the same webpage to communicate with eachother (as you're aiming the socket at localhost). Can anybody confirm/deny this ?

When you use this class, consider the following security model:

  • Sending or receiving data is not allowed if the calling file is in the local-with-file-system sandbox and the target resource is from a network sandbox.
  • Sending or receiving data is also not allowed if the calling file is from a network sandbox and the target resource is local.
  • The calling file and the network resource being accessed must be in exactly the same domain. For example, a file at can send or receive data only from sources that are also at
  • Websites can permit cross-domain access to a resource through a cross-domain policy file.

I found an interesting case where a developers used a webcam directly from unity (I don't find flash stuffs in it). But in documentation no a word about the webcameras at all. How it even possible?

From docs:

Unity has extensive support for C, C++ or Objective-C based Plugins. Plugins will work in standalones only. They are disabled when building a Web Player for security reasons.