7 Replies Latest reply on Feb 2, 2011 2:59 PM by kglad

    [as2] LocalConnection

    marcelozepgames Level 1

      Hi.

      I´m trying to make a score ranking with actionscript.

      I´m using LocalConnection.

      Here´s my code in game.swf:

       

       

      sendScore = new LocalConnection();
      sendScore.onStatus = function(infoObj:Object)
      {
        switch (infoObj.level)
        {
         case 'status' :
          trace("LocalConnection ok")

          break;
         case 'error' :
          trace("Error");
            break;
        }
      };
      sendScore.send("rankingScores","compareScores",Game.times);

       

      Here´s my code in ranking.swf:

       

      var getScore:LocalConnection = new LocalConnection()
      getScore.connect("rankingScores")
      getScore.compareScores=function(times_arr:Array):Void{

       

      trace("compareScores_called")
      test.text = times_arr[0]
      }

      Both swfs are in the same directory.

      I´m having the "Error" output.

       

      The ranking.swf is loaded inside game.swf, which, is loaded inside preloader.swf

       

      Any help?

       

      Thanks