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

166 Appendix A: Using NetServices and Connection Classes
The following example illustrates these steps:
myService.logout();
gatewayConnection.setCredentials("", "");
The technique that you use to authenticate the user and to authorize access on the application
server depends on the application server you are using.
Creating the service object
Before you access a service function, you must use the
getService() method of the gateway
connection object to create a service object in the Flash client. The
gatewayConnection.getService() method takes the following two parameters:
• The service name.
• Optionally, the name of the Flash responder object that will receive the results. If you omit the
Flash responder, you must specify a Flash responder in each service function call. For more
information on considerations for specifying a Flash responder, see “Handling results for a
Connection object” on page 167.
The following example shows the
getService() method for the remoteservices service, which
contains a
helloWorld() function:
import mx.remoting.NetServices;
import mx.remoting.Connection;
if (inited == null)
{
inited = true;
NetServices.setDefaultGatewayUrl("http://localhost:8300/flashservices/
gateway")
var gatewayConnection:Connection = NetServices.createGatewayConnection();
howdyService =
gatewayConnection.getService("remoteservices", this);
howdyService.helloWorld();
}
function helloWorld_Result(result)
{
// display successful result
messageDisplay.text = result;
}
In this example, you create the howdyService Service object.
By specifying
"this" as the responder object, you specify that the current Flash object is also the
responder that contains the result handling method. It is a common practice to create the service
object and define the result-handler callback routines in a single Flash object.