有意返回AMFPHP的错误

时间:2010-03-19 20:43:41

标签: php flash actionscript-3 remoting amfphp

当使用amfphp进行flash远程处理时,我可以在php中编写什么来触发我在Flash中的Responder中设置的'status'方法?

或者更一般地说,如何确定服务呼叫是否失败?对我来说理想的解决方案是在php服务器端抛出一些异常,并在flash客户端中捕获该异常......其他人如何使用闪存远程处理服务器错误?

var responder = new Responder(
    function() {
        trace("some normal execution finished successfully.  this is fine.");
    }, function(e) { 
        trace("how do I make this trigger when my server tells me something bad happened?");
    } 
);
myService = new NetConnection;
myService.connect("http://localhost:88/amfphp/gateway.php");
myService.call("someclass.someservice", responder);

1 个答案:

答案 0 :(得分:1)

我弄清楚我做错了什么。从php调用throw将正确触发Responder的错误处理程序,但我用来嗅探网络流量的工具正在阻碍并搞乱调用。