I have followed the examples in gotoAndplay and in the SFS documentation.
However whenever I use java code in AS I get an compilation error
var util = Packages.java.util
var map = new util.HashMap()
1120: Access of undefined property Packages.
OR
var map = new Packages.java.util.HashMap()
1120: Access of undefined property Packages.
What am i missing here?
- VTween
Java code in AS
Calling Java from Actionscript
The smartfox server uses the Rhino engine by mozilla.org for its ActionScript interpreter. (actually a "Javascript" interpreter). The mozilla site has additional documentation on invoking Java from Javascript, including this:
http://www.mozilla.org/rhino/ScriptingJava.html
For converting parameters and return values between java and AS you want to look at the org.mozilla.javascript.* API documentation, particularly Context, Scriptable, and ScriptableObject.
http://www.mozilla.org/rhino/ScriptingJava.html
For converting parameters and return values between java and AS you want to look at the org.mozilla.javascript.* API documentation, particularly Context, Scriptable, and ScriptableObject.