我的 flex 客户端应用程序存在严重问题。我有一个带有 php web 服务的 apache 服务器。flex 客户端发出一个 httpservice 请求。我注意到从应用程序的 creationComplete 事件运行的 httpservice 请求并不总是从服务器获取数据。但从用户操作调用的 HTTPservice 请求始终有效。
我还注意到,当我直接从 Flex Builder 3 运行 flex 客户端应用程序而不将其上传到服务器时,问题出现的频率较低。
在应用程序中:
mx:Application creationComplete="Init()" verticalScrollPolicy="off" horizontalScrollPolicy="off" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#5d8eb1"
private function Init():void
{
var http_request:HTTPService = new HTTPService();
http_request.url = "http://"+this.server_name+":"+this.server_port+"/services/client/client_result.php";
http_request.resultFormat = "e4x";
http_request.addEventListener("result",resultFunc);
http_request.send();
http_request.disconnect();
}