Securing Access To Coldfusion From Flash Remoting - MACROMEDIA FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT 2.0 Use Manual

Using flash remoting for flash mx 2004 actionscript 2.0
Table of Contents

Advertisement

To handle the results of the web service method, you create an event handler with the same name
as the service functions with
displays the results in the
function getCategories_Result(result:ResultEvent):Void {
// display successful result
myGrid.dataProvider = result.result;
}
function getCategories_Fault(fault:FaultEvent):Void {
message_txt.text = fault.fault.description;
}
In this example, the result of the web service function call, represented by the
property, is assigned to the
appears in the Flash application.

Securing access to ColdFusion from Flash Remoting

You can use the ColdFusion security mechanism to control access to ColdFusion files from Flash,
just as you control access to any ColdFusion page. In this way, you can grant Flash applications
access to only selected ColdFusion code.
ColdFusion security is based on a username and password. Flash Remoting applications can pass
the user name and password information using the
From within your ColdFusion Application.cfm page, you can use the
information.
The following example passes a user name and password to ColdFusion:
import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.rpc.RelayResponder;
import mx.rpc.ResultEvent;
import mx.rpc.FaultEvent;
//...
var myService:Service = new Service(
"http://localhost/flashservices/gateway",
null,
"securityTest.thecfc",
null,
null);
myService.connection.setCredentials("myUserid", "myPassword");
Note: Typically, you do not hard-code a user name and password within a Flash application, because
SWF files can be easily decompiled.
You use the
cflogin
example Application.cfm file shows:
<cfsilent>
<cflogin>
<cfif isDefined("cflogin")
116
Chapter 6: Using Flash Remoting with ColdFusion MX
or
_Result
_Fault
DataGrid component, as the following example shows:
myGrid
property of the DataGrid component,
dataProvider
tag to retrieve the user name and password information, as the following
appended to the name. The result handler
setCredentials()
cflogin
result.result
, which
myGrid
function in ActionScript.
tag to access this

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT 2.0 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash remoting mx

Table of Contents