加载失败:IO错误:错误#2032:流错误

时间:2013-06-18 07:49:57

标签: php actionscript-3 flash-cs5

我在尝试调用php时遇到此错误。

加载失败:HTTP状态= 0 加载失败:IO错误:错误#2032:流错误。网址:http://www.xxxxxxx.com/xxx/Login.php

请帮我解决这个问题, 代码如下,

function checkLogin (e:Event):void
{           
    var phpVars:URLVariables = new URLVariables();
    var phpFileRequest:URLRequest = new URLRequest("http://www.xxxxxxx.com/xxx/Login.php");
    phpFileRequest.method = URLRequestMethod.POST;
    phpFileRequest.data = phpVars;
    phpLoader = new URLLoader();
    phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;   
    phpLoader.addEventListener ( IOErrorEvent.IO_ERROR, handleIOError );
    phpLoader.addEventListener(Event.COMPLETE, handleComplete );
    phpLoader.addEventListener ( HTTPStatusEvent.HTTP_STATUS, handleHttpStatus );
    phpLoader.addEventListener ( SecurityErrorEvent.SECURITY_ERROR, handleSecurityError);

    phpVars.userName = userName.text;
    phpVars.passwords = passwords.text;

    phpLoader.load(phpFileRequest);
}

        function handleHttpStatus ( event:HTTPStatusEvent ):void
        {
            trace ( "Load failed: HTTP Status = " + event.status );
        }
        function handleSecurityError ( event:SecurityErrorEvent ):void
        {
            trace ( "Load failed: Security Error: " + event.text );
        }
        function handleComplete ( event:Event ):Void
        {
            trace ( "The data has successfully loaded" );
        }
        function handleIOError ( event:IOErrorEvent ):void
        {
            trace ( "Load failed: IO error: " + event.text );
        }

1 个答案:

答案 0 :(得分:0)

如果你说你已经测试过PHP正常工作,那么它可能是一个跨域问题,因为你试图访问被阻止的域名。

添加跨域策略文件。

更多信息here