| Contents > Developing ColdFusion MX Applications > Using the Flash Remoting Service > Using the Flash Remoting service with ColdFusion Java objects |
|
|
|
|
||
You can run various kinds of Java objects with ColdFusion MX, including JavaBeans, Java classes, and Enterprise JavaBeans. You can use the ColdFusion MX Administrator to add additional directories to the classpath.
When you place your Java files in the classpath, the public methods of the class instance are available to your Flash movie.
For example, assume the Java class utils.UIComponents exists in a directory in your ColdFusion classpath. The Java file contains the following code:
package utils;
public class UIComponents
{
public String sayHello()
{
return "Hello";
}
}
Note: You cannot call constructors with Flash Remoting. You must use the default constructor.
In ActionScript, the following getService call invokes the sayHello public method of the utils.UIComponents class:
#include "NetServices.as"
NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
gatewayConnection = NetServices.createGatewayConnection();
javaService = gatewayConnection.getService("utils.UIComponents", this);
javaService.sayHello();
function sayHello_Result(result)
{
trace(result);
}
Note: For more information about using Java objects with ColdFusion, see Using Java objects.
|
|
||
| Contents > Developing ColdFusion MX Applications > Using the Flash Remoting Service > Using the Flash Remoting service with ColdFusion Java objects |
|
|
ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6.1
Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/usings11.htm