home *** CD-ROM | disk | FTP | other *** search
/ Champak 48 / cdrom_image.iso / Games / bossbash.swf / scripts / DefineSprite_1027 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-09-28  |  1.5 KB  |  82 lines

  1. function decideGam(num)
  2. {
  3.    _root.dagam = num;
  4.    _root.gotoAndStop("gameoverview");
  5. }
  6. function chooseRando()
  7. {
  8.    var _loc1_ = random(3);
  9.    decideGam(_loc1_);
  10. }
  11. function showStars()
  12. {
  13.    i = 0;
  14.    while(i < 9)
  15.    {
  16.       var thing = eval("s" + i);
  17.       thing.full._visible = false;
  18.       i++;
  19.    }
  20.    i = 0;
  21.    while(i < 3)
  22.    {
  23.       if(i < _root.so.data.stars[0])
  24.       {
  25.          var thing = eval("s" + i);
  26.          thing.full._visible = true;
  27.       }
  28.       i++;
  29.    }
  30.    cv = 0;
  31.    i = 3;
  32.    while(i < 6)
  33.    {
  34.       if(cv < _root.so.data.stars[1])
  35.       {
  36.          var thing = eval("s" + i);
  37.          thing.full._visible = true;
  38.       }
  39.       cv++;
  40.       i++;
  41.    }
  42.    cv = 0;
  43.    i = 6;
  44.    while(i < 9)
  45.    {
  46.       if(cv < _root.so.data.stars[2])
  47.       {
  48.          var thing = eval("s" + i);
  49.          thing.full._visible = true;
  50.       }
  51.       cv++;
  52.       i++;
  53.    }
  54. }
  55. _root.so = SharedObject.getLocal("bosses");
  56. if(_root.so.data.stars == undefined)
  57. {
  58.    _root.so.data.stars = new Array(0,0,0);
  59.    _root.so.data.timesplayed = new Array(0,0,0);
  60. }
  61. if(_root.so.data.stars[0] == 3 && _root.so.data.stars[1] == 3 && _root.so.data.stars[2] == 3)
  62. {
  63.    wyn._visible = true;
  64.    wyn.onPress = function()
  65.    {
  66.       gratz._visible = true;
  67.    };
  68. }
  69. else
  70. {
  71.    wyn._visible = false;
  72. }
  73. if(_root.so.data.stars[0] == 3 && _root.so.data.stars[1] == 3 && _root.so.data.stars[2] == 3 && !_root.so.data.seenit)
  74. {
  75.    gratz._visible = true;
  76. }
  77. else
  78. {
  79.    gratz._visible = false;
  80. }
  81. showStars();
  82.