我想知道为什么一个网络请求可以在FlashCS5和本地浏览器中工作,但当我在网上发布它时,它失败了,这是每个人的经验。survivorId是从字符串查询中发送的。两个测试都是在调用网络数据库的情况下完成的。
我尝试过以下几种方法:
在文本字段中输出survivorId,并查看参数变量是否正确发送。
在发布设置中设置“仅联网”选项。
另外,有没有一种方法可以从浏览器输出跟踪操作,以便进行更深入的调试?
*编辑:我已经在本地浏览器中重新创建了错误。如果没有跟踪操作,我不知道我是否能弄清楚。
*EDIT2:这个bug之所以出现是因为它来自localhost (抱歉,这太奇怪了)
这是我的代码,这里有"Stage“,然后是" localSurvivor "( movieclip ),然后在localSurvivor电影剪辑中,"lPlayer”类是addChild() to localSurvivor MovieClip
Stage-> localSurivor-> lPlayer(survivorId);在舞台上是这样的代码:
//Set localP Id
var survId:Number = root.loaderInfo.parameters.sId;
//Object(root).informationTxt.text = survId;//加载电影剪辑Classes_____________________________
//Load Local Survivor
var localP:MovieClip = new lPlayer(survId);
//Add to stage
Object(root).localPlayer.addChild(localP);
//------------------------------------------然后在lPlayer类内部:
public function lPlayer(survId:Number) {
//First retrieve player information(Position, SWF File, MapId, etc, etc)
//Prepare data to request
netVariables.act = "fortDetails";
netVariables.survivorId = survivorId;
netRequest.method = URLRequestMethod.POST
netRequest.data = netVariables;
netLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
//Attach Event Handler to proccess data
netLoader.addEventListener(Event.COMPLETE, proccessFirstRun);
}
private function proccessFirstRun(rawData:Event) {
var playerInfo = rawData.target.data
//Player Info Loaded, Load the player onto the board
this.x = playerInfo.setx;
this.y = playerInfo.sety;
//Activate remote Survivors with fortId
Object(root).remotes.changeLevel(playerInfo.fid);
Object(root).zombieContain.changeLevel(playerInfo.fid);
}
//Request Data
netLoader.load(netRequest);发布于 2011-04-01 10:37:11
嗯,你刚刚添加了一个注释,表明你已经在本地复制了这个bug。在这种情况下,我们不再有任何信息可以继续下去。要在火狐中跟踪,请使用http://blog.coursevector.com/flashbug
发布于 2011-04-01 08:13:46
您可能遇到了跨站点限制。如果您要查询的服务器与托管swf的服务器不同,可能会有一些限制。
https://stackoverflow.com/questions/5507760
复制相似问题