问题:
AS3代码
- 语言:php,flash remoting
- 环境:wampserver2.0h(Apache 2.2.11,php 5.2.9,mysql 5.1.33), Flash CS4, amfphp1.9
-
- "http:// www@rightactionscript@com/flashremoting/gateway.php" (@改为.) 这个网关测试是可以的,有返回数据。
- 本地amfphp/browser/测试和amfphp/gateway.php测试也是正确的。
- 但是连接本地网关就会报错:
- Error #2044: 未处理的 NetStatusEvent:。 level=error, code=NetConnection.Call.BadVersion。
PHP 环境配置的问题
解决问题:
http://rjdesignz.com/blog-entries/error-2044-unhandled-netstatusevent-levelerror-codenetconnection-call-badversion/
文章介绍如下:
Recently I was working on an AMFPHP test application and came across a strange problem. I was developing an application in Flash CS4 with AS3 and running a script on my WAMP server. on calling a PHP service, from my Flash Application, I kept on getting this error:
AS3代码
- Error #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Call.BadVersion at Main()
But the strange thing here was that the application was giving this error when running within the Flash IDE. When the application was run after publishing, it was working perfectly fine.
Through some research on the internet and on posting my problem on few forums, someone pointed out to me to check the server side log files.
On checking the apache log files I found the following error:
AS3代码
- PHP Fatal error: Uncaught exception 'VerboseException' with message 'Standalone Flash player disabled. Update gateway.php to allow these connections' in C:\\wamp\\www\\amfphp\\core\\amf\\app\\Gateway.php:357\nStack trace:\n#0 [internal function]: amfErrorHandler(256, 'Standalone Flas...', 'C:\\wamp\\www\\amf...', 357, Array)\n#1 C:\\wamp\\www\\amfphp\\core\\amf\\app\\Gateway.php(357): trigger_error('Standalone Flas...', 256)\n#2 C:\\wamp\\www\\amfphp\\gateway.php(137): Gateway->disableStandalonePlayer()\n#3 {main}\n thrown in C:\\wamp\\www\\amfphp\\core\\amf\\app\\Gateway.php on line 357
Following the error log, I found that the problem was due to a security check added in the gateway.php file:
AS3代码
- Disable profiling, remote tracing, and service browser
-
- 2 $gateway->disableDebug();
-
- 3
-
- 4 $gateway->disableStandalonePlayer();
So on commenting out this piece of code, I was able to get the application running from within the Flash IDE.
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。