Reputation: 13
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
.
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");
}
Upvotes: 0
Views: 38
Reputation: 1374
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 the end of the game you can have something like: goToAndStop(99)
which will point to that new Frame.
Upvotes: 0