Flash over C++/Java?


I'm new to Flash and consider using it to develop a game. Outer skin should be Flash. Can all the logic be handled in Flash? logic involves complex physics...
I actually though the engine should be written in C++, but now I face the issue of how to communicate with the Flash.
I believe XMLSockets/communications to Javascript is not the solution I seek, but that's all I know there is.
So, what non-Flash modules can I embed inside the Flash application?

Elad Hollander.
Who is Participating?
wings_gauravConnect With a Mentor Commented:

You can't embed any modules inside flash. You can obviously delegate to an external module written in C++, VB, JAVA, C# etc.

I can somewhat relate to the problem - have done 3d & physics engines in flash. Upto say 1000 polygons  is max you can squeeze out of flash. So in case your in not that complex then flash has adequate support to program - if performane and very complex models need to be done then delegate.

If you are planning a standalone application then C++ container is the best way forward. The communication can happen directly using com events. Flash script has FSCommand function that can be used to notify the container - be it html, c++, vb, etc. On the other hand all the containers can access/manipulate variables inside the flash movie directly.

Although the above solution is the best in terms of raw performace - you will need to implement it differently over different paltforms - win32, mac, linux etc.

Another slightly unknown way is to hack into LocalConnection object. This object allows flash movies to communicate on a single machine using AMF. Although this is not documented officialy but has been publicly known for sometime. There is c/c++ code avialable that will allow you to use this communication channel to hook up flash with c++.

if you are looking at online/ multi platform implementation then XMLSocket and Java is great. Don't get mislead by the name XMLSocket - it doesn't need to be XML data that you can send on it. You can send any custom format raw data and parse it :)

hope this helps


Dushan De SilvaConnect With a Mentor Technology ArchitectCommented:
Yes you can handled all logics in Flash.

If you properly design it no need to use C++ or Java. But if you want you can access those files using flash simple command's like getURL. And if you want you can access C++/Java libraries using "include". Flash action scripting is Object Oriented and its mostly like Java. But not that much difficult. Its very easy. Very user freindly enviroment is there for scripters.
You can read more from www.kirupa.com

BR Dushan
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.