How to connect an ActionScript 3 client to a Java server?

I'm thinking of creating a 2D browser with a downward MMO version. I want it to be a flash game because it gives it a much wider target audience, but I also want to have real-time multiplayer actions for which Java speed could help, and I correctly say that the ActionScript 3 client will the Java server do the trick?

I'm just wondering if: a) the above is correct and viable, and b) how can this be achieved or is it the same as connecting a Java client to a Java server? (I am not familiar with ActionScript 3 right now)

+4
source share
2 answers

A few ways.
1) You can directly call java objects using Adobe BlazeDS or a third-party Granite data service. BlazeDS is deployed as a Tomcat / Java EE server or servlet. this task is to marshal your data objects between AS3 ↔ Java Object and call java class methods.

2) You can call any internal web services or Rest interface using the Flex HTTPService object.

+2
source

I would use sockets. Flash gives you access to network sockets that you can send json to, or whatever your preferred format.

+2
source

Source: https://habr.com/ru/post/1414546/


All Articles