User Guide
Table Of Contents
- Contents
- About Flash Remoting
- Getting Started
- Using Flash Remoting ActionScript
- Using the RemotingConnector component (Flash Professional only)
- Using Flash Remoting Data in ActionScript
- About Flash Remoting and data types
- Understanding Action Message Format
- Converting from ActionScript to application server data types
- Converting from application server data types to ActionScript
- ColdFusion to ActionScript data conversion issues
- About working with objects
- About working with RecordSet objects
- About working with XML
- The NetConnection Debugger
- Using Flash Remoting with ColdFusion MX
- Using Flash Remoting for Java
- About Flash Remoting for Java
- Calling Java classes or JavaBeans from ActionScript
- Calling Enterprise JavaBeans (EJBs) from Flash
- Calling servlets and JSPs from Flash
- Calling JMX MBeans from Flash (JRun only)
- Calling server-side ActionScript from Flash (JRun only)
- Handling function results in ActionScript
- Using Flash Remoting with JRun security
- Passing XML objects between Flash and Java
- Viewing Flash Remoting log entries
- Using Flash Remoting for Microsoft .NET
- Flash Remoting for Microsoft .NET
- Calling ASP.NET pages from Flash
- Making an ASP.NET page available to Flash Remoting
- Getting a reference to an ASPX-based service in ActionScript
- Invoking ASPX pages in ActionScript
- Using the Flash Remoting custom server control in ASPX pages
- Using the Flash Remoting namespace in code-behind files
- Using ASP.NET state management with Flash Remoting
- Using ASP.NET exception handling
- Using ADO.NET objects with Flash Remoting
- Displaying a RecordSet object in Flash with ActionScript
- Calling web services from Flash
- Calling ASP.NET assemblies from Flash
- Viewing Flash Remoting log entries
- Using NetServices and Connection Classes
- Index

122 Chapter 7: Using Flash Remoting for Java
The following table lists standard ways to add classes to the system classpath:
Getting a reference to a Java class or JavaBean in ActionScript
Before calling methods of a Java class or JavaBean from ActionScript, you must get a reference to
the Java object.
To get a reference to a Java object:
1.
Import the following files:
import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;
2.
Establish the Flash Remoting gateway and get a reference to the Java class or JavaBean as shown
in the following example:
var flashtestService:Service = new Service(
"http://localhost/flashservices/gateway",
null,
"flashgateway.samples.FlashJavaBean",
null,
null);
The first parameter of the Service constructor is the gateway URL. The third parameter is the
fully qualified class name of the Java class or JavaBean.
Note: There are several other ways to specify the gateway URL. For more information, see
“Establishing the Flash Remoting gateway connection” on page 37.
Application server Classpath information
Sun™ ONE Web
Server
In the Web Server Administration Server console, add classes to the
Classpath field in the Configure JVM Attributes page of the Java panel.
IBM® WebSphere® In the WebSphere Application Server Console, add classes to the
Classpath field of the JVM Settings page for your server. In the
server-cfg.xml tree in the left pane of the console, JVM Settings is under
WebSphere Administrative Domain > Nodes > nodename > Application
Servers > servername > Process Definition.
Note: To call a class or JavaBean in WebSphere, you also must grant
clients permission to access the package that contains the class or
JavaBean. To do this, you add a line to the default permissions granted to all
domains in the websphere_root/AppServer/java/jre/lib/security/java.policy
file. For example, the following line lets users access the Flash Remoting
sample classes in the flashgateway.samples package:
permission java.lang.RuntimePermission
"accessClassInPackage.flashgateway.samples";
JRun Copy classes to the jrun_root/jrun_server/SERVER-INF/classes directory in
subdirectories that match the package structure of the classes. Copy JAR
files to the jrun_root/jrun_server/SERVER-INF/lib directory.