作者tk5301 (小猪)
看板Flash
标题Re: [问题] flash 无法顺利连结PHP
时间Wed Jul 25 16:39:15 2012
※ 引述《tk5301 (小猪)》之铭言:
: 执行都会出现以下错误
: Error #2044: 未处理的 IOErrorEvent:。 text=Error #2035: 找不到 URL。
: 底下是一些程式码
: import flash.net.URLRequest;
: import flash.net.URLVariables;
: import flash.net.URLLoader;
: import flash.events.Event;
: var url:String="http://project.tkmspace.com/magic/getQueandAns1.php";
: var urlRQ:URLRequest=new URLRequest(url);
: urlRQ.method=URLRequestMethod.POST;
: var dataLength:Number=0;
: var LDR:URLLoader=new URLLoader();
: LDR.load(urlRQ);
: 希望大家能帮帮忙
这是後续的程式码
LDR.addEventListener(Event.COMPLETE,abc);
function abc(e:Event):void{
var getVars:URLVariables = new URLVariables(e.target.data);
dataLength=parseInt(getVars.Count);
queID=new Array();
queID=getVars.Id.split("^");
queID.addEventListener(Event.COMPLETE,ff);
}
function ff(event:Event):void {
var lldr:Loader;
lldr = new Loader();
lldr.load(new URLRequest(queID[1]));
bg_mc.addChild(lldr);
}
如果把前面载入路径改成
http://localhost/getQueandAns1.php
这样可行吗??
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 163.17.133.18
1F:推 pm2001:localhost...... 07/25 16:44
2F:→ tk5301:LOCALHOST 怎麽了吗?? 07/25 17:40
3F:推 chengchieh:把queID[1]给trace出来吧...看实际去call哪个address 07/25 17:55
4F:→ chengchieh:localhost是你机器上的http server path 07/25 17:56
5F:→ chengchieh:要看你是要读本机还是前面的网站上的 07/25 17:57
6F:→ leenl:这问题我早在知识加就回答他,code都没问题正常读出php内容 07/28 15:42