
Calling ASP.NET assemblies from Flash
159
In the ActionScript code, you specify the
serviceName
argument with a URL that produces
WSDL. The
getTemp
function maps to the web service method of the same name. Here,
zip
represents an input text field, and
tempDisplay
represents a dynamic text field.
To see the web service proxy assembly (with the .dll extension) that Flash Remoting creates, look
in your local assembly cache for a DLL with the same name as the web service. For the
Temperature web service, look for a DLL named TemperatureService.dll.
Calling ASP.NET assemblies from Flash
Using Flash Remoting, you can invoke .NET assembly files (with the .dll extension) from Flash.
In your ActionScript code, you use the fully qualified assembly or class file name in the
serviceName
argument, and for the service function name, you use an assembly or class method
name. On the server, you must place your DLL and class files in the local assembly cache.
Calling assemblies from Flash
In the class file, you specify the
using
directive to reference the Flash Remoting assembly
namespace FlashGateway.IO, as the following C# example shows:
using System;
using FlashGateway.IO;
namespace FlashRemoting.EchoTests
{
public class EchoClass
{
public EchoClass()
{
///Public constructor... initialize any member fields here if need be.
}
public string echoString(string s)
{
return s;
}
}
}
In the ActionScript code, you use the namespace and public class name defined in the class file, as
the following example shows:
import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.rpc.RelayResponder;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;
var classService:Service = new Service(
"http://localhost/myASPApp/default.aspx",
null,
"FlashRemoting.EchoTests.EchoClass",
null,
null);
var pc:PendingCall = classService.echoString(input.text);
pc.responder = new RelayResponder(this, "echoString_Result",
Содержание FLASH REMOTING MX
Страница 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...