User Guide

Table Of Contents
Building Flash applications with Flash Remoting 19
Building the remote service
Flash Remoting supports Java, ASP.NET, and ColdFusion-based remote services. For a simple
Hello World application, the following table lists the application server code by platform and
specifies where to save the file to make it available to Flash Remoting.
For more information about application server-specific code, see the following chapters:
Chapter 6, “Using Flash Remoting with ColdFusion MX,” on page 97
Chapter 7, “Using Flash Remoting for Java,” on page 119
Chapter 8, “Using Flash Remoting for Microsoft .NET,” on page 143
Calling the remote service from Flash using Flash Remoting ActionScript
To build a Flash application that uses Flash Remoting, you write ActionScript in the Flash
authoring environment to connect to the remote service and call a service function.
To build a Flash application that calls remote services using Flash Remoting:
1.
In the Flash authoring environment, create a new Flash file and save it as serviceTest.fla.
2.
Drag the RemotingClasses library onto the Stage as described in “Connecting to a service”
on page 18.
3.
In the Document window, insert a text field.
Application
server
Application server code File location
ColdFusion MX
<cfset flash.result = "Hello from
ColdFusion MX!">
Save the ColdFusion page as
helloWorld.cfm in a folder named
remoteservices under your web root.
JRun 4
package com.remoteservices;
import java.io.Serializable;
public class FlashJavaBean
implements Serializable {
private String message;
public FlashJavaBean() {
message = "Hello from Java!";
}
public String helloWorldJava() {
return message;
}
}
Save the compiled JavaBean class
file to classes/com/remoteservices
folder under the SERVER-INF
directory.
ASP.NET
<%@ Register TagPrefix="Macromedia"
Namespace="FlashGateway"
Assembly="flashgateway" %>
<%@ Page language="c#" debug="true" %>
<Macromedia:Flash ID="Flash"
runat="server">
Hello from .NET!
</Macromedia:Flash>
Save the ASPX page as
helloWorldNET.aspx in the
flashremoting directory under your
web root.