Jump to content

Send score to PHP from Flash silently?


vexious

Recommended Posts

We currently have this bit of code in fla (Flash 8). It sends a users high score to the php file. Does anyone know how to do this silently aka not having to refresh or redirect the page?

Thanks..

 

Current Code:

 

function New() {
if (_root.MaxScore<_root.Score) 
getURL("http://domain.com/postscore.php?score="+_root.Score + "&level="+_root.level, "_top", "POST");
Show();
gotoAndStop("Display");

}

Link to comment
https://forums.phpfreaks.com/topic/87847-send-score-to-php-from-flash-silently/
Share on other sites

  • 11 months later...

We currently have this bit of code in fla (Flash 8). It sends a users high score to the php file. Does anyone know how to do this silently aka not having to refresh or redirect the page?

Thanks..

 

Current Code:

 

function New() {
if (_root.MaxScore<_root.Score) 
getURL("http://domain.com/postscore.php?score="+_root.Score + "&level="+_root.level, "_top", "POST");
Show();
gotoAndStop("Display");

}

 

yes in flash you would use:


 

You would just have to make sure that your variable is nested in a movie clip. so in your example it would probably look like this.

 

This code would go in the main timeline actions layer

 

//your event onEnterFrame or button.onRelease or any other event

savescore_btn.onRelease = function()
{
   highscore_mc.highscore_tophp = highscore_mc.highscore_textfield.text;
   highscore_mc.loadVariables("phpfilename.php", "POST");
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.