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

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

Advertisement

Highlight the text field and in the Property inspector, name the text field messageDisplay and
4.
select Dynamic Text in the menu.
Open the Actions panel and insert the following ActionScript code, replacing variables that
5.
appear in italics with the values that correspond to the server you are using. These values are
provided following the code:
import mx.remoting.Service;
import mx.services.Log;
import mx.rpc.RelayResponder;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;
import mx.remoting.PendingCall;
import mx.remoting.RecordSet;
// connect to service and create service object
var howdyService:Service = new Service(
"gatewayUrl",
new Log(),
"serviceName",
null,
null );
// call the service helloWorld() method
var pc:PendingCall = howdyService.serviceFunctionName();
// tell the service what methods handle result and fault conditions
pc.responder = new RelayResponder( this, "serviceFunctionName_Result",
"serviceFunctionName_Fault" );
function serviceFunctionName_Result(result:ResultEvent)
{
// display successful result
messageDisplay.text = result.result;
}
function serviceFunctionName_Fault(fault:FaultEvent)
{
//display fault returned from service
messageDisplay.text = fault.fault.faultstring;
}
The ActionScript code creates a new Service object,
connection and a reference to the remote service. You specify the following variables:
The
gatewayUrl
Remoting. For example, the following
http://localhost:8500/flashservices/gateway
value for your remote service.
The Log object, to which debugging messages are sent. For more information, see the Log
class in Flash Remoting ActionScript Dictionary Help.
20
Chapter 1: Getting Started
, which depends on the location of the application server running Flash
gatewayUrl
, to create both the gateway
howdyService
connects to a ColdFusion service:
. Specify the appropriate
gatewayUrl

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?

Questions and answers

This manual is also suitable for:

Flash remoting mx

Table of Contents