home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / kung_fu.swf / scripts / __Packages / com / KidFighting / BackgroundGUI.as < prev    next >
Encoding:
Text File  |  2006-06-13  |  1.6 KB  |  50 lines

  1. class com.KidFighting.BackgroundGUI extends MovieClip
  2. {
  3.    static var _sprite;
  4.    static var _playingSound;
  5.    static var _items = [_root.bg_item1,_root.bg_item2,_root.bg_item3,_root.bg_item4];
  6.    function BackgroundGUI()
  7.    {
  8.       super();
  9.       com.KidFighting.BackgroundGUI._sprite = this;
  10.    }
  11.    static function onRoundInit(evtObj)
  12.    {
  13.       var _loc2_ = evtObj.enemyId;
  14.       if(_loc2_ != undefined)
  15.       {
  16.          ds.controls.SoundPlayer.stopSound(com.KidFighting.BackgroundGUI._playingSound);
  17.          if(_loc2_ >= 6)
  18.          {
  19.             com.KidFighting.BackgroundGUI._sprite.gotoAndStop(2);
  20.             com.KidFighting.BackgroundGUI._playingSound = "Music_loop_axegang";
  21.             _root.bg_item1.hide();
  22.             _root.bg_item2.hide();
  23.             _root.bg_item3.show();
  24.             _root.bg_item4.show();
  25.          }
  26.          else
  27.          {
  28.             com.KidFighting.BackgroundGUI._sprite.gotoAndStop(1);
  29.             com.KidFighting.BackgroundGUI._playingSound = "Music_loop_pigsty";
  30.             _root.bg_item1.show();
  31.             _root.bg_item2.show();
  32.             _root.bg_item3.hide();
  33.             _root.bg_item4.hide();
  34.          }
  35.       }
  36.       ds.controls.SoundPlayer.playSound(com.KidFighting.BackgroundGUI._playingSound,"loop");
  37.    }
  38.    static function onRoundEnd()
  39.    {
  40.       ds.controls.SoundPlayer.stopSound(com.KidFighting.BackgroundGUI._playingSound);
  41.    }
  42.    static function onFightActivated(evtObj)
  43.    {
  44.       for(var _loc2_ in com.KidFighting.BackgroundGUI._items)
  45.       {
  46.          com.KidFighting.BackgroundGUI._items[_loc2_].fightActivated(evtObj);
  47.       }
  48.    }
  49. }
  50.