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

Calling service functions 41
Flash supplies the login credentials with each service request; therefore, your ActionScript should
log the user out of the application server and reset the credentials when the user logs out of your
Flash application.
To log out the user and reset the credentials:
1.
Call a logout service function on the server that logs out the user.
For example, for ColdFusion, call a method that uses the
cflogout tag.
2.
Set the gateway connection credential information to empty strings.
The following example shows 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’re using.
Using authentication in ColdFusion MX
If you use ColdFusion, the
setCredentials() method causes Flash Remoting to put the login
ID and password in the ColdFusion page’s CFLogin scope whenever you request a service. The
Application.cfm page for the ColdFusion page or ColdFusion component should process this
information as necessary in a
cflogin tag. For more information on implementing security in
ColdFusion, see “Securing access to ColdFusion from Flash Remoting” on page 116.
Using authentication in JRun 4
Authentication in JRun 4 is only meaningful for EJBs, where you can use the
setCredentials()
method to enable access to secured EJB methods. You must configure your application server for
single sign-on. The Flash gateway provides the security credentials to the login module. For more
information on authentication in JRun 4, see “Using Flash Remoting with JRun security”
on page 139.
Calling service functions
To call the functions exposed by a Service object, you use the object name followed by the service
function name. In the following example,
petMarketService is the Service object name and
getCategories() is the name of the function that is called:
var temp_pc:PendingCall = petMarketService.getCategories("en_US");
The getCategories() function exists in the application server as a public method or application
page. The function also passes a string parameter,
"en_US", to specify the language in which the
function should return the categories. To pass multiple parameters to service functions, you
include a comma-separated list of values in the service function call. If the
getCategories()
function also allowed you to specify a type of category, for example, the parameters would look
like this:
petMarketService.getCategories("en_US", "Accessories");