MiniGame 在 FlashCS5 中运行正常,但在线时失败
我想知道每个人的经验是什么,为什么网络请求可以在 FlashCS5 和本地浏览器中工作,但当我将其发布到网上时却失败了。 survivorId
从字符串查询中发送。两项测试都是通过调用网络数据库完成的。
我尝试了以下操作:
在文本字段中输出 survivorId
并查看参数变量是否正确发送。
在发布设置中设置“仅网络”选项。
还有一种方法可以从浏览器输出跟踪操作以进行更深入的调试?
*编辑:我已在浏览器中本地重新创建了该错误。如果没有跟踪操作,我不知道我是否能弄清楚。
*编辑2:该错误仅出现,因为它来自本地主机(抱歉,这很奇怪)
这是我的代码,有“Stage”,然后是“localSurvivor”(movieClip),然后在 localSurvivor movieclip 的“lPlayer”类中就是 addChild() 到 localSurvivor MovieClip
Stage-> localSurivor-> lPlayer(survivorId);
舞台上是这样的代码:
//Set localP Id
var survId:Number = root.loaderInfo.parameters.sId;
//Object(root).informationTxt.text = survId;
//Load Movie Clip 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);
I was wondering what is everyone's experience are on why a network request would work in FlashCS5 and in a browser locally but when I post it online it fails. The survivorId
is sent from the string query. Both tests were done calling a network database.
I've tried the following:
Outputting the survivorId
in a text field and seeing if the parameter variables were being sent correctly.
Set the "Networking Only" option in the publish settings.
Also is there a way to output trace actions from browsers for more in depth debugging?
*EDIT: I have recreated the bug locally in a browser. Without trace actions i don't know if i can figure it out.
*EDIT2: That bug only showed up because its from localhost (apologies, this is just weird)
Here's my code, there is the "Stage" then it goes "localSurvivor"(movieClip) then in side that localSurvivor movieclip the "lPlayer" class is addChild() to localSurvivor MovieClip
Stage-> localSurivor-> lPlayer(survivorId);
On the stage is this code:
//Set localP Id
var survId:Number = root.loaderInfo.parameters.sId;
//Object(root).informationTxt.text = survId;
//Load Movie Clip Classes_____________________________
//Load Local Survivor
var localP:MovieClip = new lPlayer(survId);
//Add to stage
Object(root).localPlayer.addChild(localP);
//------------------------------------------
Then inside the lPlayer Class:
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);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嗯,您刚刚添加了一条注释,表明您已在本地重现了该错误。在这种情况下,我们就不再有任何信息可以继续。要在 Firefox 中进行跟踪,请使用 http://blog.coursevector.com/flashbug
hm, you just added a note that you've reproduced the bug locally. In that case we no longer have any information to go on. To trace in Firefox use http://blog.coursevector.com/flashbug
您可能遇到了跨站点限制。如果您查询的服务器与托管 swf 的服务器不同,则可能会受到限制。
You are probably hitting cross-site restrictions. There can be restrictions if the server you're querying is different from the server hosting the swf.