简体   繁体   English

动作脚本2.0自动提交

[英]action script 2.0 auto submit

I have the following code, which works great. 我有以下代码,效果很好。 The only down side is that the user must click on the submit score button in order for the code below to work. 唯一的缺点是用户必须单击“提交分数”按钮才能使下面的代码起作用。
Is there anyway possible that one could make this an automatic feature? 无论如何,有可能使它成为一种自动功能吗? So that when the game is finished the user will automatically be taken to test2.php . 这样,当游戏结束时,用户将自动被带到test2.php

on(release){
  sendscore = new LoadVars();
  sendscore.gameID = "e97b67c67b00e382";
  sendscore.username = _root.username;
  sendscore.score = _root.highscore;
  sendscore.userID = _root.userID;
  sendscore.sessionID = _root.sessionID;
  sendscore.table = _root.table;
  sendscore.tid = _root.tid;
  sendscore.send("/test2.php","_self","POST");
}

You need some kind of the event listener to listen for and which triggers after game is finished. 您需要某种事件侦听器来侦听,并在游戏结束后触发。

Alternatively you can put your code without on(release) into specific Frame on the timeline. 或者,您可以将没有on(release)代码放入时间轴上的特定Frame。

On the end of the game you can have something like: goToAndStop(99) which will point to that new Frame. 在游戏结束时,您可以拥有类似于goToAndStop(99) ,它将指向该新框架。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM