home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Puzzle / bubble_elements.swf / scripts / DefineSprite_147_mc_settings / frame_1 / DoAction.as
Encoding:
Text File  |  2007-03-20  |  2.3 KB  |  83 lines

  1. function ok(pnm)
  2. {
  3.    var _loc1_ = _root;
  4.    var _loc2_ = pnm;
  5.    if(_loc2_ != "")
  6.    {
  7.       _loc1_.playerName = _loc2_;
  8.       _loc1_.pn.text = _loc2_;
  9.    }
  10.    _loc1_.saveProcess(1);
  11.    _loc1_.killsetting();
  12.    _loc1_.stopother(true);
  13.    removeMovieClip(this);
  14. }
  15. this.onKeyDown = function()
  16. {
  17.    if(Key.isDown(13))
  18.    {
  19.       if(this.pn2.text.substr(0,6) == "$cmd$:")
  20.       {
  21.          var mycmd = this.pn2.text.substr(6,this.pn2.text.length).split("/");
  22.          switch(mycmd[0])
  23.          {
  24.             case "pass":
  25.                _root.saveProcess(16);
  26.                break;
  27.             case "clear":
  28.                delete _root.so.data.playerProcess;
  29.                break;
  30.             case "don":
  31.                var _loc0_ = null;
  32.                _root.vQuestBubbles = _loc0_ = mycmd[1];
  33.                _root.vArcadeBubbles = _loc0_;
  34.                break;
  35.             case "cn":
  36.                k = mycmd[1] * 17;
  37.                while(k < mycmd[2] * 17)
  38.                {
  39.                   _root.ClearTheCell(k,false);
  40.                   k++;
  41.                }
  42.                break;
  43.             case "sv":
  44.                _root.saveAll(_root.playerName,mycmd[1] * 100);
  45.                break;
  46.             case "show":
  47.                k = 0;
  48.                while(k < _root.endline + 17)
  49.                {
  50.                   if(eval("_root.Cell" + k) != null)
  51.                   {
  52.                      removeMovieClip(eval("_root.Cell" + k));
  53.                   }
  54.                   if(!_root.BBL[k].Moveable)
  55.                   {
  56.                      _root.attachMovie("Cell","Cell" + k,k + 1000);
  57.                      eval("_root.Cell" + k)._x = _root.BBL[k].X;
  58.                      eval("_root.Cell" + k)._y = _root.BBL[k].Y;
  59.                   }
  60.                   k++;
  61.                }
  62.                break;
  63.             case "hide":
  64.                k = 0;
  65.                while(k < _root.endline + 17)
  66.                {
  67.                   if(eval("_root.Cell" + k) != null)
  68.                   {
  69.                      removeMovieClip(eval("_root.Cell" + k));
  70.                   }
  71.                   k++;
  72.                }
  73.          }
  74.          ok(_root.playerName);
  75.       }
  76.       else
  77.       {
  78.          ok(this.pn2.text);
  79.       }
  80.    }
  81. };
  82. Key.addListener(this);
  83.