问题
I have an application written in java, and I want to add a flash front end to it. The flash front end will run on the same computer as the java app in the stand alone flash player. I need two way communication between the two parts, and have no idea how to even start going about this. I suppose I could open a socket between the two programs, but I feel that there must be an easier way. Is there a nice part of the api in actionscript 3.0 that will allow me to access java methods directly, or will I have to resort to sockets? I am relatively new to flash, by the way, so any good guides would be much appreciated!
Thanks
回答1:
AMF is a messaging protocol commonly used to talk between flash and a backend system. There're several Java implementations, but I haven't used any of them so can't tell you which is best.
- Blaze DS
- Red5
- Granite DS
Flash can also talk plain old XML, SOAP or REST to the backend, so depending on your codebase that might be easier.
回答2:
There is also OpenAMF. It is very mature, stable, simple and lightweight relative to Blaze, Red5 and Granite.
BUT, it is also dated (AMF0 protocol only) and the project is no longer active. Lots of people are still using it out in the wild. And the documentation is borderline non-existent.
回答3:
Granite DS is a good solution, it will allow you to set up services to communicate not only to POJO's but to EJB3 session beans also. It comes with a GAS code generator for converting your java beans into as3 equivalents and also data push to the client using the gravity side project.
回答4:
MERAPI is a bridge framework for communication between Java and Flash.
回答5:
I agree on Granite DS. It was easy to setup and get going.
I have used it to talk directly with a EJB3 bean communicating with thrift generated objects.
来源:https://stackoverflow.com/questions/77598/getting-java-and-flash-to-talk-to-each-other