V3 Arcade (vBulletin) - how does it work!?

Hello,

I think this is a JavaScript question, although the problem involves ActionScript and PHP too…

(I’m a Developer/coder for several years, but am stumped with this one, so I hoping one of you Geniuses can help me figure it out…)

V3 Arcade is the popular arcade games add-on for vBulletin forums.

SWF games are modified to include a blank movie clip containing the following code:


// 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 () {
    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;
    }
}

These SWF games are them embeded in the page in the usual way:


<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,14,0" width="600" height="600">
  <param name="movie" value="./games/snake.swf">
  <param name="quality" value="high">
  <embed src="./games/snake.swf" quality="high" width="600" height="600" quality="high"
  pluginspage="http://www.macromedia.com/go/getflashplayer"
  type="application/x-shockwave-flash"></embed>
</object>

When the game is over and the “_root.gameover == 1” variable is set, the SWF submits the LoadVars() via a sendAndLoad() using the “POST” method to “./arcade.php”, and the page reloads to display your highscore, etc.

I am trying to recreate this, to embed a few of these games on my site, and I have called the page “./arcade.php”, but when the games finishes, it doesn’t seem to post to the page?

Is there some extra javascript or AJAX needed on the “./arcade.php” page, to listen or receive the sendAndLoad() vars and reload the page?

Any help would be greatly appreciated!