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


Load failed: IO error: Error #2032: Stream Error

当我试图调用php时,我得到这个错误。

Load failed: HTTP Status = 0加载失败:IO错误:错误#2032:流错误。URL: 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 );
        }

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

添加跨域策略文件。

更多信息在这里