ActionScript 3的AMF的Zend无提示失败
我试图连接到一个Zend - PHP服务一个纯ActionScript程序中。我已经成功地使用成功地使用Flex的服务。 (但Flex移动应用程序是臃肿,通常10倍比纯ActionScript应用程序更大 - 这就是为什么我想要写在纯ActionScript)
I'm trying to connect to a Zend-PHP service within a pure ActionScript program. I've managed to use the service successfully using Flex. (But Flex mobile apps are bloated, and typically 10x bigger than pure ActionScript apps - which is why I'm trying to write it in Pure Actionscript).
我试图访问我下载了PHP / Zend的服务,并在下面的教程中使用: -
I'm trying to access the PHP/Zend service that I downloaded, and used in the following tutorial:-
http://www.adobe.com/devnet/flex/ testdrivemobile /用品/ mtd_1_1.html
这是我连接到PHP code是可以从这个网站下载 - 关于如何使用它的Flex以及说明
The PHP code that I'm connecting to is available as a download from this site - as well as instructions about how to use it in Flex.
这是我写的动作: -
And this is what I've written in ActionScript:-
protected var _netConnection:NetConnection;
protected var _responder:Responder;
//...
_netConnection = new NetConnection();
_responder = new Responder(complete, errorFn);
_netConnection.addEventListener(NetStatusEvent.NET_STATUS, errorFn);
_netConnection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorFn);
_netConnection.connect("http://localhost/TestDrive/services/EmployeeService.php");
_netConnection.call("EmployeeService.getEmployeesSummary", _responder);
public function complete(result:Object):void {
trace("complete");
}
当我运行它,它静静地失败。没有回调。如果我更改连接或调用方法的参数,errorFn回调的工作 - (我试过很多的东西) - 我能得到NetConnection.Call.BadVersion,或NetConnection.Call.Failed。但我从来没有设法叫回来完整的方法。
When I run this, it fails silently. No callbacks. If I change the parameters of the connect or call method, the errorFn callbacks work - (I've tried lots things) - I can get NetConnection.Call.BadVersion, or NetConnection.Call.Failed. But I've never managed to get the complete method called back.
有什么建议?
我花了很长的时间才能实现 - 但门户网址是指向错误的PHP文件。 (但有code不是默默失败,并取得了一些诊断,可能我到了那里更快)。总之 - 感谢您的帮助大家
It took me a long time to realise - but the gateway url was pointing to the wrong .php file. (But had the code not failed silently, and yielded some diagnostics, I might have got there quicker). Anyway - Thanks for your help everyone.