• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by peko · Dec 01, 2009 at 11:47 AM ·

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?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by Brian-Kehrer · Dec 01, 2009 at 08:33 PM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by Jon 4 · Jun 24, 2010 at 12:42 AM

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 fusedworks.com

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by PatHightree · Jan 06, 2010 at 01:19 PM

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 www.adobe.com can send or receive data only from sources that are also at www.adobe.com.
  • Websites can permit cross-domain access to a resource through a cross-domain policy file.
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by peko · Jul 14, 2010 at 10:47 AM

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.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Mike 3 · Jul 14, 2010 at 11:27 AM 0
Share

The page is just unity rendered over a flash control (You can see it load before unity)

avatar image peko · Jul 15, 2010 at 09:03 AM 0
Share

No way, you are wrong, it can not be an flash container, because flash alaways show security window and ask you to approw webcam activation. Open the html file there is no traces of flash loading at all.

Besides it in html you can find an strange thing, it uses strange version of unity player download_webplayer_boffswana_3, normaly it must be download_webplayer-2.x.

Probably it is an answer it uses "special" webplayer

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Can someone help me fix my Javascript for Flickering Light? 6 Answers

Material doesn't have a color property '_Color' 4 Answers

How to import the object from server to unity 2 Answers

Setting Scroll View Width GUILayout 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges