A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Sending variables to PHP

  1. #1
    Join Date
    Feb 2005

    Sending variables to PHP

    so making a high score board i can use in my games. the tutorial i found (every tutorial i found, in fact) was AS2, so i've taking the principles in the tutorial and converting them to AS3. I'm pretty darn close to having it work. i have it successfully pulling the data in the php/database to the flash file and listing the contents of the high score board, but i seem to be missing something when sending new name and score info to it.

    here is my test file:


    you can see the high score list comes up (the info coming in is from when i went through the AS2 tutorial), but as you can see it's not adding the name and score you enter in the first part to the list.

    here is code i'm using to send the info:

    var sendScoreVars:URLVariables = new URLVariables();
        sendScoreVars.userName = userName;
        sendScoreVars.myScore = userScore;
        var kingdomUrlRequest:URLRequest = new URLRequest();
        kingdomUrlRequest.method = "POST";
        kingdomUrlRequest.url = "http://actionfigurekingdom.com/addScore.php";
        var loaderForScores:URLLoader = new URLLoader();
        loaderForScores.data = sendScoreVars;
        loaderForScores.addEventListener(Event.COMPLETE, onLoaderForScoresComplete);
    so what am i missing? any help would be greatly appreciated. also if anyone wants to look at the fla source file i can upload that too.


  2. #2
    Senior Member
    Join Date
    Jul 2008
    Try kingdomUrlRequest.method = URLRequestMethod.POST;

    That's what I do instead of "POST", don't know if it makes a difference though.

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