98
Chapter 6: Using Flash Remoting with ColdFusion MX
For example, suppose you create a ColdFusion page named helloWorld.cfm in the directory
helloExamples under your web root (
web_root
/helloExamples). You can then use the following
ActionScript in your Flash application to call helloWorld.cfm:
import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.rpc.RelayResponder;
//…
var CFMService:Service = new Service(
"http://localhost/flashservices/gateway",
null,
"helloExamples",
null,
null);
var pc:PendingCall = CFMService.helloWorld();
pc.responder = new RelayRsponder(this, "helloWorld_Result",
"helloWorld_Fault");
//…
To specify subdirectories of the web root directory or a virtual directory, use package dot notation.
If helloWorld.cfm is in the directory
web_root
/helloExamples/ColdFusion, you can use the
following ActionScript to create the service:
import mx.remoting.Service;
//
…
var CFMService:Service = new Service(
"http://localhost/flashservices/gateway",
null,
"helloExamples.ColdFusion",
null,
null);
Remember to use periods to delimit directory names for the
new Service()
constructor.
Using the Flash scope to pass parameters to ColdFusion pages
ColdFusion MX defines an application scope called
Flash
that you use to access parameters passed
from Flash applications and return values to Flash applications. The application scope associates
variables with one, named application on a server.
Содержание FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT...
Страница 1: ...Using Flash Remoting for Flash MX 2004 ActionScript 2 0...
Страница 8: ...8 Contents...
Страница 62: ...62 Chapter 3 Using the RemotingConnector component Flash Professional only...
Страница 142: ...142 Chapter 7 Using Flash Remoting for Java...