Within the server-side extension environment, it is not limited to using the provided ActionScript API. We can use Java class to extend the extension.
One benefit of mixing Java class into our ActionScript extension is that we can gain extra performance with the precompiled native code. It is especially useful for complex codes such as path finding or XML parsing.
The other benefit is that we can archive a lot more possibility in extension with the Java programming.
We can use native Java class directly in the following way:
var javaList = new java.util.LinkedList(); var message = new java.lang.String("This is a JAVA string");
We can also access the SmartFoxServer Java API in ActionScript extension. For example, we can access the zone.
var javaExt = Packages.it.gotoandplay.smartfoxserver.extensions.ExtensionHelper; var helper = javaExt.instance(); var zone = helper.getZone("virtualWorld");
Or we can access any custom class by using the Packages...