您的位置:首页 > 编程语言 > ASP

FluorineFx:实现Flex与ASP.NET的协同开发之组件库

2012-09-13 22:01 543 查看
参考资料:[code]Flex和.NET协同开发利器FluorineFx
Flex 数据交互的三种方式(WebService、HttpService、Remoting)
Flex与ASP.NET通过Remoting方式进行通讯 (使用第三方组件 RemoteObjectAMF0 实现AMF网关通信)
用FluorineFx库实现Silverlight远程过程调用

注意事项:



1.Flex 3必须指定 services-config.xml

(主要是为了找到 remoting-config.xml 中的 <destination /> 的id)

方法一:Project Properties > Flex Compiler > Additional compiler arguments:
-locale en_US -services "x:\...\FlexWebSite\WEB-INF\flex\services-config.xml"
或使用相对路径 "..\..\WEB-INF\flex\services-config.xml"
方法二:直接在Flex3 > .actionScriptProperties 文件中设置
<compiler additionalCompilerArguments=
"-locale en_US -services "..\..\WEB-INF\flex\services-config.xml"" .../>


2. 其余信息可在 Flex3 > .flexProperties 中设置

<flexProperties aspUseIIS="true" flexServerType="32"
serverContextRoot="/FlexWebSite"
serverRoot="H:/.../FlexWebSite"
serverRootURL="http://localhost:4776/FlexWebSite/"
toolCompile="true" useServerFlexSDK="false" version="1"/>

3.Flex3与ASP.NET 中 <destination id="fluorine"> 的AMF 网关通信

可使用第三方actionscript库 RemoteObjectAMF0 实现
使用 <mx:RemoteObject />

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:RemoteObject id="service" destination="fluorine"
source="ServiceLibrary.Sample">
<mx:method name="Echo" result="onResult(event)">
</mx:method>
</mx:RemoteObject>
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
internal function onClick():void
{
service.Echo(txtInput.text);
}

internal function onResult(evt:ResultEvent):void
{
txtResult.text = evt.result.toString();
}
]]>
</mx:Script>

<mx:Panel x="53" y="52" width="250" height="200" layout="absolute" title="测试FluorineFx" fontSize="12">
<mx:TextInput x="35" y="21" id="txtInput"/>
<mx:Button x="35" y="63" label="确 定" fontWeight="normal" click="onClick()"/>
<mx:Label x="35" y="95" text="结 果:"/>
<mx:TextInput x="35" y="123" width="160" id="txtResult"/>
</mx:Panel>

</mx:Application>




待续。。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐