0 Replies Latest reply on Mar 15, 2013 9:16 AM by mandar vedak

    How to set session

    mandar vedak

      How can I set/create a "Session" in flash AS2.


      for example, I want click on a button, then an action will fire. This action will set an session and will save a score like a (for example 3000 points).


      Then I wanna use this session(string) in php.


      How can I do that?

       

      onEnterFrame = function () {

      clearInterval(showTime);

      delete showTime;

      };

       

      my_btn.onRelease=function(){

      var myVars:LoadVars = new LoadVars();

       

      myVars.playerName = "your";

      myVars.playerScore = score;

       

      myVars.send("score-board.php", "_parent", "POST");

      SessionVar.set("Score", "playerScore"); // this is right for create session in as2

      }

       

      or in php ==============================

      <?PHP
      session_start();
      print_r($_SESSION);
      echo($_POST['playerName'] . "'s score: " . $_POST['playerScore'] . " points.");
      ?>