php redirect using flash
Posted: Fri May 26, 2006 10:44 am
I have a swf game that when it reaches gameover it executes the below actionscipt code and should redirect the page to arcade.php.
I cant change the swf code, but I do know it works becuase it works on other arcades. I must make my arcade code compatable with the game.
I have the rest of the arcade script done, but I dont know where to start with the variables being sent by the game and how to achieve the redirect using this code.
Code: Select all
// HERE THE ARCADE SESSION IS INITIATED
// DON'T FORGET TO CHANGE THE GAMENAME VALUE!
if (this.sessionstarted != 1) {
this.arcade = new LoadVars();
this.sessionvars = new LoadVars();
this.arcade.gamename = "towerball";
this.arcade.sessdo = "sessionstart";
this.arcade.sendAndLoad("arcade.php", sessionvars, "POST");
this.sessionstarted = 1;
}
// IF GAMEOVER=1, SUBMIT THE SCORE AND REDIRECT THE PAGE
if (_root.gameover == 1) {
if ((this.askpermission != 1) && (this.sessionvars.connStatus == 1)) {
this.prequestvars = new LoadVars();
this.pranswer = new LoadVars();
this.prequestvars.gametime = this.sessionvars.gametime;
this.prequestvars.fakekey = this.sessionvars.initbar;
if (_root.score == 0) {
this.prequestvars.score = -1;
} else {
this.prequestvars.score = _root.score;
}
this.prequestvars.id = this.sessionvars.lastid;
this.prequestvars.sessdo = "permrequest";
this.prequestvars.note = (this.prequestvars.id*this.prequestvars.score*this.prequestvars.fakekey);
this.prequestvars.sendAndLoad("./arcade.php", this.pranswer, "POST");
this.askpermission = 1;
}
if ((this.pranswer.validate == 1) && (this.finalsent != 1)) {
this.burnscore = new LoadVars();
this.burnscore.microone = this.pranswer.microone;
this.burnscore.gametime = this.prequestvars.gametime;
this.burnscore.id = this.prequestvars.id;
if (_root.score == 0) {
this.burnscore.noscore = 1;
}
this.burnscore.sessdo = "burn";
this.burnscore.send("./arcade.php", "_self", "POST");
this.finalsent = 1;
}
}I have the rest of the arcade script done, but I dont know where to start with the variables being sent by the game and how to achieve the redirect using this code.