php redirect using flash

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Citizen
Forum Contributor
Posts: 300
Joined: Wed Jul 20, 2005 10:23 am

php redirect using flash

Post by Citizen »

I have a swf game that when it reaches gameover it executes the below actionscipt code and should redirect the page to arcade.php.

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 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.
Citizen
Forum Contributor
Posts: 300
Joined: Wed Jul 20, 2005 10:23 am

Post by Citizen »

Any help on this? I'd be willing to paypal $10 to the person that helps me fix this.
Citizen
Forum Contributor
Posts: 300
Joined: Wed Jul 20, 2005 10:23 am

Post by Citizen »

Anyone please?

If noone here knows what I need to do, can you direct me to a different forum that would?
ianhull
Forum Contributor
Posts: 310
Joined: Tue Jun 14, 2005 10:04 am
Location: Hull England UK

Post by ianhull »

// IF GAMEOVER=1, SUBMIT THE SCORE AND REDIRECT THE PAGE

This code will send the variables to php

this.burnscore.send("./arcade.php", "_self", "POST");
after this place

getURL("yourpage.php", "_self");
this way your variables have been sent and you then redirect to the page.
Citizen
Forum Contributor
Posts: 300
Joined: Wed Jul 20, 2005 10:23 am

Post by Citizen »

Thats not the problem.

I cant change the actionscript code nor am i the one that made it. I have to make my php arcade script compatable with that code in the swf, which is hardwired into every game that would run on my arcade.

I've coded everything in my php arcade except for the part that receives the score. Thats what I need help with.
Post Reply