jsonic for as3 移植完了

いったん移植は終わったっぽい。これでRemoteObjectっぽく、JSONICJSON-RPCとやり取りできるようになった。打倒S2Flex2(w

<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:js="http://arnx.net/jsonic"
    initialize="init()">
    <js:WebService id="remote" fault="onFault(event)"
        endpoint="http://localhost:8080/sample/rpc/rpc.json"
        source="calc">
        <js:Operation name="plus" result="onResult(event)" />
    </js:WebService>
    <mx:Script>
    <![CDATA[
        import mx.rpc.events.FaultEvent;
        import mx.rpc.events.ResultEvent;
        import net.arnx.jsonic.JSON;

        private function init():void {
            remote.plus(10, 10);
        }

        private function onResult(event:ResultEvent) {
            trace(event.result); // 10+10 => 20
        }

        private function onFault(event:FaultEvent) {
        }
    ]]>
    </mx:Script>
</mx:WindowedApplication>

とはいいつつ、元のJSONICの方も仕様を変更中なので、JSONIC1.1と同時リリースにしよう。まだ、クリーンナップもイマイチだし。

[追記] ソースはsourceforge.jpのSVNから取得 or 閲覧できます。