IMPORT JAVA

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
ganapathi
Posts: 8
Joined: 28 Mar 2011, 05:45
Location: chennai

IMPORT JAVA

Post 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
Last edited by ganapathi on 09 Sep 2011, 10:14, edited 1 time in total.
/Ganapathi
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Smartfox's forum is my daily newspaper.
ganapathi
Posts: 8
Joined: 28 Mar 2011, 05:45
Location: chennai

Post by ganapathi »

Yes, i have seen this.. but where i can put my java class file.. ie) java class path..
/Ganapathi
ganapathi
Posts: 8
Joined: 28 Mar 2011, 05:45
Location: chennai

Post by ganapathi »

Hello guys,

still i am having this problem.. any one help me..
/Ganapathi
ganapathi
Posts: 8
Joined: 28 Mar 2011, 05:45
Location: chennai

Post 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..
/Ganapathi
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post 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.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Post Reply