MACROMEDIA FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT 2.0 Use Manual page 103

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

Advertisement

The directory name is the service address, and the helloWorld.cfm file is a method of the
helloExamples directory of the Flash Remoting service. The following ActionScript example calls
the helloWorld ColdFusion page:
import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.rpc.RelayResponder;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;
var CFMService:Service = new Service(
"http://localhost:8300/flashservices/gateway",
null,
"helloExamples",
null,
null);
var pc:PendingCall = CFMService.helloWorld();
pc.responder = new RelayResponder(this, "helloWorld_Result",
"helloWorld_Fault");
function helloWorld_Result( re:ResultEvent ):Void {
trace( re.result.HELLOMESSAGE ); // will output "Hello World"
trace( re.result.TIMEVAR ); // will output current date
}
function helloWorld_Fault( fe:FaultEvent ):Void {
}
Within the result handler of the
ColdFusion.
Returning record sets to Flash
A Flash application often calls a ColdFusion page so that the ColdFusion page can access a
database and return a record set to the Flash application. For example, the following ColdFusion
code executes a query and returns the results of the entire query to the Flash application:
<cfquery name="myQuery" datasource="ExampleApps">
SELECT *
FROM tblItems
</cfquery>
<cfset Flash.Result = myQuery>
You can pass parameters from the Flash application to the ColdFusion page to conditionalize the
query. The previous section contained an example that passed a parameter to the
the query, as the following code shows:
<cfquery name="myQuery" datasource="ExampleApps">
SELECT ItemName, ItemDescription, ItemCost
FROM tblItems
WHERE ItemName='#Flash.Params[1]#'
</cfquery>
<cfset Flash.Result = myQuery>
method, you access the structure returned by
helloWorld()
Using Flash Remoting with ColdFusion pages
clause of
WHERE
103

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