Jump to content

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");
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.