Flex .NET使用remoting技術互動—FluorineFx開發配置

來源:互聯網
上載者:User

FluorineFx官方網站:http://www.fluorinefx.com/

FluorineFx開發文檔:http://www.fluorinefx.com/docs/fluorine/index.html

一、.NET服務端開發

安裝FluorinFx,建立一個FluorineFx類庫,如。

在解決方案中添加一個網站(會自動引用TestServiceLibrary.dll),

運行網站中的console.aspx,得到如下介面表示伺服器端完成,現在利用類庫中內建的函數Echo來開發配置Flex端。

二、Flex端開發配置

建立一個Flex Project 命名為:FNtest

點擊下一步

點擊完成。在flex導覽列裡點擊FNtest右鍵選擇Properties(屬性)如

選擇Flex Compiler 在Additional compiler arguments裡添加“services-config.xml”

選擇Flex BuildPath:在Output folderURL裡填上:http://localhost:1862/Web/bin-debug/

選擇flex server:在context root裡填上/web,配置完成。

編程寫代碼:

代碼

<mx:RemoteObject id="RO" destination="fluorine" source="TestServiceLibrary1.Sample">
  <mx:method name="Echo" result="onResult(event)"/>
 </mx:RemoteObject>
 <mx:Script>
  <![CDATA[
   import mx.rpc.events.ResultEvent;
   public function onResult(evt:ResultEvent):void{
    txt1.text=evt.result.toString();
   }
   public function onClick():void{
    RO.Echo(txt.text);
   }
  ]]>
 </mx:Script>
 <mx:TextInput id="txt" x="149" y="121"/>
 <mx:TextInput id="txt1" x="149" y="175"/>
 <mx:Button click="onClick()" x="337" y="121" label="Button"/>

 

運行結果:

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.