Page 1 of 1

IMPORT JAVA

Posted: 09 Sep 2011, 07:58
by ganapathi
Hello,

i want to use java class methods in flash as1 file. so how to import java classes in flash as1(server side).


/ganapathi

Posted: 09 Sep 2011, 08:15
by BigFIsh

Posted: 09 Sep 2011, 08:34
by ganapathi
Yes, i have seen this.. but where i can put my java class file.. ie) java class path..

Posted: 12 Sep 2011, 04:33
by ganapathi
Hello guys,

still i am having this problem.. any one help me..

Posted: 12 Sep 2011, 05:38
by ganapathi
java class are available in "javaExtension" folder and action script class are in "sfsExtension" folder..

how can i import java class in as1..

Posted: 12 Sep 2011, 08:50
by rjgtav
Hi. As it explains in the first link posted by BigFIsh, you have to first create a var which references the package of the class you want to use, by using a code like:

var testPackage = Packages.test.testPackage;

Or you can directly create a new instance of that class by doing:

var testClass = new Packages.test.testPackage.testClass();

As also mentioned in that link, "In order to access your custom classes you should add them to the classpath in the start.bat (Win) or start.sh (Linux) scripts.", so you don't have to add them to the javaExtensions folder.

The 2nd link that was posted has a clear example of how to use a custom class, in that case, a xml reader.