I have a little problem in my code. Please check this code and let me know wht is problem. It is not posts data to remote server. The problem is in first two functions and second function is called by third one as your see.
function data_sent () {
trace("Data Sent");
}
function post_results(userid,session,score) {
var postData:URLVariables = new URLVariables();
postData.uid = '00031653156431'; //User ID;
postData.ses = 'gtrgrwe6gt46e54hy6e5hy'; //Session;
postData.scr = '5487'; // Score
// Post data to database
var loader:URLLoader = new URLLoader();
var req:URLRequest = new URLRequest("http://example.com/post.php");
req.method = URLRequestMethod.POST;
req.data = postData;
try
{
loader.addEventListener(BulkLoader.COMPLETE,this.data_sent());
loader.load(req);
loader.start();
}
catch (error:Error)
{
trace("Unable to load requested document.");
}
}
function endGame() {
//
trace("END GAME");
this.post_results('0000534256562','a6erf4a6erf4','6589');
//
// create game over panel
setInterval(showMessage,3000);
this.attachMovie("gameover","gameover",11);
targ = this.gameover;
//
// position panel
targ._x = _root.gameWid/2;
targ._y = _root.gameHei/2-5;
targ._xscale = 1;
targ._yscale = targ._xscale;
targ.bounceMe(100,.4,.4);
//
// store high scores, reset bonus vars
_root.flushAndSend();
_root.pauseGame = true;
_root.timeBonus = 0;
}

New Topic/Question
Reply


MultiQuote


|