home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / eroticos / MemoryBodies-Volume2.exe / scripts / DefineSprite_331 / frame_1 / DoAction.as
Text File  |  2004-11-17  |  2KB  |  85 lines

  1. function ShuffleCards()
  2. {
  3.    cardArray = new Array();
  4.    var startArray = [1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12];
  5.    var placeArray = new Array();
  6.    a = 0;
  7.    while(a < startArray.length)
  8.    {
  9.       placeArray.push(a);
  10.       a++;
  11.    }
  12.    a = 0;
  13.    while(a < startArray.length)
  14.    {
  15.       do
  16.       {
  17.          trg = random(placeArray.length);
  18.          newplace = placeArray[trg];
  19.       }
  20.       while(startArray[a] == startArray[newplace] && a != startArray.length - 1);
  21.       
  22.       placeArray.splice(trg,1);
  23.       if(startArray[a] != startArray[newplace])
  24.       {
  25.          cardArray.push(startArray[newplace]);
  26.       }
  27.       else
  28.       {
  29.          cardArray.unshift(startArray[newplace]);
  30.       }
  31.       a++;
  32.    }
  33. }
  34. function ConvertTimeToText(ConvertNumber)
  35. {
  36.    if(ConvertNumber)
  37.    {
  38.       var tempMinutes = String(int(Math.floor(Number(ConvertNumber / 60))));
  39.       var tempSeconds = String(int(Math.floor(Number(ConvertNumber))) - int(Math.floor(Number(ConvertNumber / 60))) * 60);
  40.       var tempTenths = ConvertNumber.toString().split(".");
  41.       if(tempMinutes.length < 2)
  42.       {
  43.          tempMinutes = "0" add tempMinutes;
  44.       }
  45.       if(tempSeconds.length < 2)
  46.       {
  47.          tempSeconds = "0" add tempSeconds;
  48.       }
  49.       if(!tempTenths[1])
  50.       {
  51.          tempTenths[1] = 0;
  52.       }
  53.       else
  54.       {
  55.          tempTenths[1] = tempTenths[1].charAt(0);
  56.       }
  57.       return tempMinutes add ":" add tempSeconds add "." add tempTenths[1];
  58.    }
  59.    return "00:00.0";
  60. }
  61. function CheckNull(checkstring)
  62. {
  63.    if(checkstring.length < 1)
  64.    {
  65.       return true;
  66.    }
  67.    if(checkstring == "")
  68.    {
  69.       return true;
  70.    }
  71.    if(checkstring == null)
  72.    {
  73.       return true;
  74.    }
  75.    return false;
  76. }
  77. UseScoreboard = false;
  78. UsePersonalBest = false;
  79. MovieTitle = "CardGame";
  80. ScoreboardScriptFile = "highscores.php";
  81. ScoreboardScoresFile = "highscores.txt";
  82. TimeCookieName = "RecordGameTime";
  83. FlipsCookieName = "RecordFlipsTime";
  84. stop();
  85.