home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / starship_seven.swf / scripts / DefineSprite_98 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-03-28  |  736 b   |  34 lines

  1. function init()
  2. {
  3.    var i = 1;
  4.    while(_root.cst.maxObjects >= i)
  5.    {
  6.       tellTarget("../object_" + i)
  7.       {
  8.          _root.temp.objectFrames = _totalframes;
  9.       }
  10.       if(Number(_root.temp.objectFrames) == 0)
  11.       {
  12.          _name = "object_" + i;
  13.          break;
  14.       }
  15.       i++;
  16.    }
  17.    gotoAndStop(1);
  18. }
  19. function hit()
  20. {
  21.    if(active == true)
  22.    {
  23.       _parent._parent._parent.ship.actEnergy += 70;
  24.       if(_parent._parent._parent.ship.maxEnergy < _parent._parent._parent.ship.actEnergy)
  25.       {
  26.          _parent._parent._parent.ship.actEnergy = _parent._parent._parent.ship.maxEnergy;
  27.       }
  28.       _parent._parent._parent.ship.refreshEnergy();
  29.    }
  30. }
  31. active = true;
  32. stop();
  33. init();
  34.