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

Using Flash Remoting with JRun security 139
You can use the following ActionScript code to get the value of the LoanInfo bean’s
MonthlyPayment property, or handle a fault condition:
function calculateReturnComplex_Result (re:ResultEvent):Void
{
payOutput.text = re.result.monthlyPayment;
}
function calculateReturnComplex_Fault (fe:FaultEvent):Void
{
mx.remoting.debug.NetDebug.trace({level:"None", message:"There was a
problem" + fe.fault.faultstring});
}
For detailed information about the ActionScript result-handling hierarchy and result-handling
strategies, see Chapter 2, “Handling service results and errors,” on page 43.
Using Flash Remoting with JRun security
You can use the setCredentials() method of the Connection class in ActionScript to
authenticate Flash users to a JRun 4 server and authorize them to access EJBs after they are
authenticated. When a user cannot be authenticated, the default fault handling method on the
client can provide details.
All of the gateway adapters support authentication, but only the EJB adapter supports
authorization. After a user is authenticated, the user’s role is associated with any EJBs the user may
access, and the security permissions established in EJB deployment descriptors (ejb-jar.xml) are
enforced. Only users in specified roles are allowed to access the EJB methods. An error occurs
when the credentials provided through the
setCredentials() method do not map to a user in a
specified role.
The following sections show examples of ActionScript for setting credentials and security settings.
Looking at the ActionScript authentication code
The following example shows ActionScript code that passes a user name and password from a
Flash application to a JRun server:
var con1:Connection = new Connection();
con1.connect("http://examples.macromedia.com/flashservices/gateway/");
con1.setCredentials("Flash", "Flashpass");
Looking at the JRun security settings
The following example shows entries for the user named Flash and a role, FlashRole, to which the
user belongs, using the default security implementation (jrun-users.xml file) for a JRun server:
<user>
<user-name>Flash</user-name>
<password>Flashpass</password>
</user>
<role>
<role-name>FlashRole</role-name>
<user-name>Flash</user-name>
</role>