amfphp中文乱码问题解决方法

Filed Under (AS3, php) by CouldHll on 29-05-2010

Tagged Under : ,

问题描述:今天过测试dulux项目时候,通过amfphp传输中文的时候出现乱码,变成?????????????。

问题分析:问题应该出在编码问题上。flash中是gb编码,而amfphp是utf-8。

问题解决:
 打开gateway.php:
修改
$gateway->setCharsetHandler(“utf8_decode”, “ISO-8859-1″, “ISO-8859-1″);

$gateway->setCharsetHandler( “mbstring”, “gb2312″, “gb2312″ );
一切安逸了

amfphp远程访问问题

Filed Under (AS3, php) by CouldHll on 23-05-2010

Tagged Under : ,

问题描述:
最近在忙Dulux,在连接后台amfphp的时候,Flash返回如下错误:
Error #2044: 未处理的 NetStatusEvent:。 level=error, code=NetConnection.Call.BadVersion

问题分析:
肯定是后台有问题,可能不允许远程访问,查了下。

解决方法:
打开amf/gateway.php,找到代码:
if(PRODUCTION_SERVER)
{
    //Disable profiling, remote tracing, and service browser
    $gateway->disableDebug(); //注释掉               
    //Keep the Flash/Flex IDE player from connecting to the gateway. Used for security to stop remote connections.
    $gateway->disableStandalonePlayer(); //注释掉       
}
将这两句注释掉,重启服务。
大功告成,问题解决。