home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Puzzle / PuzzlePuzzle.swf / scripts / frame_447 / DoAction.as
Encoding:
Text File  |  2005-08-05  |  6.0 KB  |  232 lines

  1. function rrr()
  2. {
  3.    a = new Array();
  4.    i = 0;
  5.    while(i < 8)
  6.    {
  7.       a[i] = new Array("0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0");
  8.       i++;
  9.    }
  10.    a[0][0] = random(4) + 1;
  11.    a[0][1] = random(4) + 1;
  12.    a[0][2] = random(4) + 1;
  13.    a[0][3] = random(4) + 1;
  14.    a[0][4] = random(4) + 1;
  15.    a[1][0] = random(4) + 1;
  16.    a[1][1] = random(4) + 1;
  17.    a[1][2] = random(4) + 1;
  18.    a[1][3] = random(4) + 1;
  19.    a[1][4] = random(4) + 1;
  20.    a[2][0] = random(4) + 1;
  21.    a[2][1] = random(4) + 1;
  22.    a[2][2] = random(4) + 1;
  23.    a[2][3] = random(4) + 1;
  24.    a[2][4] = random(4) + 1;
  25.    a[3][0] = random(4) + 1;
  26.    a[3][1] = random(4) + 1;
  27.    a[3][2] = random(4) + 1;
  28.    a[3][3] = random(4) + 1;
  29.    a[3][4] = random(4) + 1;
  30.    a[4][0] = random(4) + 1;
  31.    a[4][1] = random(4) + 1;
  32.    a[4][2] = random(4) + 1;
  33.    a[4][3] = random(4) + 1;
  34.    a[4][4] = random(4) + 1;
  35.    a[5][0] = random(4) + 1;
  36.    a[5][1] = random(4) + 1;
  37.    a[5][2] = random(4) + 1;
  38.    a[5][3] = random(4) + 1;
  39.    a[5][4] = random(4) + 1;
  40.    a[6][0] = random(4) + 1;
  41.    a[6][1] = random(4) + 1;
  42.    a[6][2] = random(4) + 1;
  43.    a[6][3] = random(4) + 1;
  44.    a[6][4] = random(4) + 1;
  45.    a[7][0] = random(4) + 1;
  46.    a[7][1] = random(4) + 1;
  47.    a[7][2] = random(4) + 1;
  48.    a[7][3] = random(4) + 1;
  49.    a[7][4] = random(4) + 1;
  50. }
  51. function rrrb()
  52. {
  53.    b = new Array();
  54.    i = 0;
  55.    while(i < 8)
  56.    {
  57.       b[i] = new Array("0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0");
  58.       i++;
  59.    }
  60.    b[0][0] = random(4) + 1;
  61.    b[0][1] = random(4) + 1;
  62.    b[0][2] = random(4) + 1;
  63.    b[0][3] = random(4) + 1;
  64.    b[0][4] = random(4) + 1;
  65.    b[1][0] = random(4) + 1;
  66.    b[1][1] = random(4) + 1;
  67.    b[1][2] = random(4) + 1;
  68.    b[1][3] = random(4) + 1;
  69.    b[1][4] = random(4) + 1;
  70.    b[2][0] = random(4) + 1;
  71.    b[2][1] = random(4) + 1;
  72.    b[2][2] = random(4) + 1;
  73.    b[2][3] = random(4) + 1;
  74.    b[2][4] = random(4) + 1;
  75.    b[3][0] = random(4) + 1;
  76.    b[3][1] = random(4) + 1;
  77.    b[3][2] = random(4) + 1;
  78.    b[3][3] = random(4) + 1;
  79.    b[3][4] = random(4) + 1;
  80.    b[4][0] = random(4) + 1;
  81.    b[4][1] = random(4) + 1;
  82.    b[4][2] = random(4) + 1;
  83.    b[4][3] = random(4) + 1;
  84.    b[4][4] = random(4) + 1;
  85.    b[5][0] = random(4) + 1;
  86.    b[5][1] = random(4) + 1;
  87.    b[5][2] = random(4) + 1;
  88.    b[5][3] = random(4) + 1;
  89.    b[5][4] = random(4) + 1;
  90.    b[6][0] = random(4) + 1;
  91.    b[6][1] = random(4) + 1;
  92.    b[6][2] = random(4) + 1;
  93.    b[6][3] = random(4) + 1;
  94.    b[6][4] = random(4) + 1;
  95.    b[7][0] = random(4) + 1;
  96.    b[7][1] = random(4) + 1;
  97.    b[7][2] = random(4) + 1;
  98.    b[7][3] = random(4) + 1;
  99.    b[7][4] = random(4) + 1;
  100. }
  101. function ggg()
  102. {
  103.    cheng = 0;
  104.    i = 0;
  105.    while(i < 8)
  106.    {
  107.       j = 0;
  108.       while(10 >= j)
  109.       {
  110.          if(a[i][j] == 1)
  111.          {
  112.             attachMovie("red","gg" add (j * 8 + i),cheng);
  113.             setProperty("gg" add (j * 8 + i), _X, i * 35 + 35);
  114.             setProperty("gg" add (j * 8 + i), _Y, j * 35 + 55);
  115.          }
  116.          else if(a[i][j] == 2)
  117.          {
  118.             attachMovie("blue","gg" add (j * 8 + i),cheng);
  119.             setProperty("gg" add (j * 8 + i), _X, i * 35 + 35);
  120.             setProperty("gg" add (j * 8 + i), _Y, j * 35 + 55);
  121.          }
  122.          else if(a[i][j] == 3)
  123.          {
  124.             attachMovie("green","gg" add (j * 8 + i),cheng);
  125.             setProperty("gg" add (j * 8 + i), _X, i * 35 + 35);
  126.             setProperty("gg" add (j * 8 + i), _Y, j * 35 + 55);
  127.          }
  128.          else if(a[i][j] == 4)
  129.          {
  130.             attachMovie("yellow","gg" add (j * 8 + i),cheng);
  131.             setProperty("gg" add (j * 8 + i), _X, i * 35 + 35);
  132.             setProperty("gg" add (j * 8 + i), _Y, j * 35 + 55);
  133.          }
  134.          cheng += 1;
  135.          j++;
  136.       }
  137.       cheng += 1;
  138.       dic = cheng + 50;
  139.       i++;
  140.    }
  141. }
  142. function gggb()
  143. {
  144.    chengb = cheng + 1000;
  145.    i = 0;
  146.    while(i < 8)
  147.    {
  148.       j = 0;
  149.       while(10 >= j)
  150.       {
  151.          if(b[i][j] == 1)
  152.          {
  153.             attachMovie("red","gb" add (j * 8 + i),chengb);
  154.             setProperty("gb" add (j * 8 + i), _X, i * 35 + 362);
  155.             setProperty("gb" add (j * 8 + i), _Y, j * 35 + 55);
  156.          }
  157.          else if(b[i][j] == 2)
  158.          {
  159.             attachMovie("blue","gb" add (j * 8 + i),chengb);
  160.             setProperty("gb" add (j * 8 + i), _X, i * 35 + 362);
  161.             setProperty("gb" add (j * 8 + i), _Y, j * 35 + 55);
  162.          }
  163.          else if(b[i][j] == 3)
  164.          {
  165.             attachMovie("green","gb" add (j * 8 + i),chengb);
  166.             setProperty("gb" add (j * 8 + i), _X, i * 35 + 362);
  167.             setProperty("gb" add (j * 8 + i), _Y, j * 35 + 55);
  168.          }
  169.          else if(b[i][j] == 4)
  170.          {
  171.             attachMovie("yellow","gb" add (j * 8 + i),chengb);
  172.             setProperty("gb" add (j * 8 + i), _X, i * 35 + 362);
  173.             setProperty("gb" add (j * 8 + i), _Y, j * 35 + 55);
  174.          }
  175.          chengb += 1;
  176.          j++;
  177.       }
  178.       chengb += 1;
  179.       i++;
  180.    }
  181. }
  182. function sss()
  183. {
  184.    sound.gotoandplay("next");
  185.    i = 7;
  186.    while(i >= 0)
  187.    {
  188.       j = 10;
  189.       while(j >= 0)
  190.       {
  191.          a[i][j + 1] = a[i][j];
  192.          removeMovieClip("gg" add (i * 8 + j));
  193.          j--;
  194.       }
  195.       i--;
  196.    }
  197.    a[7][0] = random(4) + 1;
  198.    a[6][0] = random(4) + 1;
  199.    a[5][0] = random(4) + 1;
  200.    a[4][0] = random(4) + 1;
  201.    a[3][0] = random(4) + 1;
  202.    a[2][0] = random(4) + 1;
  203.    a[1][0] = random(4) + 1;
  204.    a[0][0] = random(4) + 1;
  205.    ggg();
  206. }
  207. function sssb()
  208. {
  209.    sound.gotoandplay("next");
  210.    i = 7;
  211.    while(i >= 0)
  212.    {
  213.       j = 10;
  214.       while(j >= 0)
  215.       {
  216.          b[i][j + 1] = b[i][j];
  217.          removeMovieClip("gb" add (i * 8 + j));
  218.          j--;
  219.       }
  220.       i--;
  221.    }
  222.    b[7][0] = random(4) + 1;
  223.    b[6][0] = random(4) + 1;
  224.    b[5][0] = random(4) + 1;
  225.    b[4][0] = random(4) + 1;
  226.    b[3][0] = random(4) + 1;
  227.    b[2][0] = random(4) + 1;
  228.    b[1][0] = random(4) + 1;
  229.    b[0][0] = random(4) + 1;
  230.    gggb();
  231. }
  232.