A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Sending Score Variable to a PHP file

  1. #1
    Senior Member
    Join Date
    May 2001
    Posts
    198
    Ok, I'm setting up a high score system for a game.
    Now the php file is workin' great, it's all set-up.
    But now I need to send the player's final score from the game, to the PHP file. So how do I export the value of this variable to the PHP file???

    I also want to code this so that it will work no matter where the game is located (in other words I want it to work even if the game is located on a server different from the PHP file)

    ANY help would be really appreciated. Thanks

  2. #2
    __OSX powered__ nucleuz's Avatar
    Join Date
    Aug 2000
    Location
    Norway
    Posts
    836
    Send to PHP:
    Code:
    loadVariables("game.php?name=" add _root.user_name add "score=" add _root.score, 0, "POST");
    About your second question: If you have your actionscript reference guide book from Macromedia: page 127: you can only load data into the movie from a file that is on a server in the same subdomain.

  3. #3
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    there is just two ways to handle the situation - one is to set up a script on the same server that just forwards the data to the other one, and the other using loadmovie like here: http://board.flashkit.com/board/show...hreadid=232712

    Musicman

  4. #4
    Senior Member
    Join Date
    May 2001
    Posts
    198
    ok. thanks. But I don't need to load any info into Flash. I'm just sending data from Flash. But are you saying that I need those methods just to send info from Flash? (in order for it to work from any server)


    here's an example of a game that does this successfully, it's the same type of score system I'm trying for.


    http://www.synj.net/flash/sacksmash.htm

    now this game exists on several websites (Newgrounds.com, Synj.net, Ham N Cheez etc.) but the score submission works just fine anywhere.


    Thanks for your great help so far

    really appreciate it

    You guys get first play when I finish work on the game

  5. #5
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    the third party restriction only applies to loadvariables, but you are using geturl to return the result to a browser window

    Musicman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center