AMF

AMFPHP

http://sourceforge.net/projects/amfphpからamfphp-0.9.0.tar.gzをサーバーへダウンロード
http://www.macromedia.com/software/flashremoting/downloads/components/よりFlash Remoting Components ActionScript? 1.0 for Flash MX 2004 and Flash MX Professional 2004をクライアントにインストール
またhttp://www.communitymx.com/content/article.cfm?cid=E79F1303C1E096EDより Remoting Tester Panelをインストール ウィンドウ>他のパネル>CMX Remoting Testerで表示されます。これは、PEAR::SOAPとNuSOAPが必要ですのでインストールしておきましょう。
あれ?いろいろとサイトを見ていると、どうもFlash MX 2004では挙動がおかしいとか、使えないとかという情報があります。なんてこった... ということで、そのかわりに、この下。

PHPObject

http://ghostwire.com/go/33からダウンロードしました。解凍して、PHPObject_AS1.mxpかPHPObject_AS2.mxpをインストールしましょう。インストール後、serverフォルダにある

config.php
Gateway.php

とexamplesフォルダにある

Bar.php
Foo.php

をサーバにコピーします。config.phpはマルチバイトに設定しておきます(以下参照)。後はas2の(Flash MX 2004なので)test.flaとmultiByteTestAS2.flaを編集して、swfを作ります。

PHPObject.defaultGatewayUrl = "http://localhost/phpobject/Gateway.php"

では実行して見ます。

http://localhost/phpobject/multiByteTestAS2.swf

おー なんと簡単に動くではないか! 戻り値はonResultで設定してありました。

マルチバイト

http://ghostwire.com/go/517にマルチバイトの設定があります。
サーバ

config.phpの$cfg['multiByte']をtrue

クライアント

PHPObject.enableMultiByte = true;

http://ghostwire.com/go/518にMySQLのサンプルがあります。ほかにもhttp://ghostwire.com/go/29にいろいろ参考になります。

SSL

SSLで正常に動作しない場合は、 Gateway.phpの_outputメソッドを

function _output()
{
	$t = serialize(($this->cfg['multiByte']) ? $this->urlencodeRecursively($this->myObj) : $this->myObj);
	$t = $this->taskid . ( (!$this->utf8encode) ? $t : utf8_encode($t) );
	if ( preg_match ('/.+MSIE.+/',$_SERVER['HTTP_USER_AGENT']) )
	{
		header('Pragma:');
	}
	header("Content-Length: " . strlen($t));
	exit($t);
}

リンク

http://www.amfphp.org/
http://www.loveloveheart.com/flash/flashremoting/amfdata.php
http://www.qns.us/amfphp/intro.php
http://amfphp.db-appli.com/
http://www.logicalyze.com/as2app/archives/flash_amfphp/index.html
http://jsgt.org/mt/archives/01/cat_flash.html

参考書籍

コメント

  • #comment

トップ   編集 凍結解除 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2008-04-03 (木) 00:46:00 (5887d)