按照网上的例子,做了一个初步的测试.配置如下:
建立文件夹:fr
把flash remoting虚拟目录下的gateway.aspx和web.config 复制到fr目录下
在fr目录下建立bin文件夹
把flash remoting虚拟目录下的bin里面的flashgateway.dll和frconfig.txt 复制到fr\bin下面
在IIS中建立虚拟目录...
建立test1.aspx的代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="fuck.aspx.cs" Inherits="_Default" %>
<%@ Register TagPrefix ="Macromedia" Namespace = "FlashGateway" Assembly = "flashgateway" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<Macromedia:Flash ID="Flash" runat =server>
</Macromedia:Flash>
</body>
</html>
然后在test1.aspx.cs里面的Page_load方法里面加入<%@ Register TagPrefix ="Macromedia" Namespace = "FlashGateway" Assembly = "flashgateway" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<Macromedia:Flash ID="Flash" runat =server>
</Macromedia:Flash>
</body>
</html>
Flash.Result = "Flash remoting!";
然后建立test.swf,建立一个textinput,名字为msg_text,然后编写AS代码,如下:
import mx.remoting.Service;
import mx.rpc.FaultEvent;
import mx.remoting.PendingCall;
import mx.rpc.ResultEvent;
import mx.rpc.RelayResponder;
var myService:Service = new Service("http://localhost/fr/gateway.aspx",null,"fr",null,null);
var pc:PendingCall = myService.fuck();
pc.responder = new RelayResponder(this, "getdata_Result","getdata_Fault");
function getdata_Result(re:ResultEvent)
{
trace(re.result);
msg_text.text = re.result;
}
function getdata_Fault(fa:FaultEvent)
{
trace("error");
msg_text.text = fa.fault.faultstring;
}
然后IE中输入http://localhost/fr/test.swf,显示正确...
但是在IE中输入http://IP地址/fr/test.swf却无法显示...
有人遇到过这问题吗?