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"/>
運行結果: