IMPORT JAVA

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

Moderators: Lapo, Bax

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

IMPORT JAVA

Postby ganapathi » 09 Sep 2011, 07:58

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
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 09 Sep 2011, 08:15

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

Postby ganapathi » 09 Sep 2011, 08:34

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

Postby ganapathi » 12 Sep 2011, 04:33

Hello guys,

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

Postby ganapathi » 12 Sep 2011, 05:38

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

Postby rjgtav » 12 Sep 2011, 08:50

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.

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 16 guests