简体   繁体   中英

Is there a way to call java methods in actionscript 3?

I want to know how to call a method in a java/class file from within my flash program so that I can navigate through files easier, and then have it return a string or integer. Is there any way to do this?

You'll need to have a separate Java applet and route communication through some appropriate Javascript glue using ExternalInterface on the Flash side and netscape.javascript.JSObject on the Java side. (The latter appears to provide some degree of cross-browser support despite its name).

ExternalInterface is one option, as Henning mentions.

If you're planning to use AIR, have a look at the Merapi project. Also, with AIR 2.x you can try NativeProcess .

If you're thinking about basic Java on the server side, either try basic Socket communication (as3 supports XML and binary Sockets). For larger scopes have a look at Blaze DS and/or Spring Flex .

HTH

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM