home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / starisland.swf / scripts / __Packages / illusoft / Help.as < prev    next >
Encoding:
Text File  |  2007-12-10  |  1.4 KB  |  55 lines

  1. class illusoft.Help
  2. {
  3.    var dmc;
  4.    var game;
  5.    var rec;
  6.    var _visible;
  7.    var ob;
  8.    var helpShown = false;
  9.    function Help(mc, rec, game)
  10.    {
  11.       this.dmc = mc;
  12.       this.game = game;
  13.       this.rec = rec;
  14.       var cref = this;
  15.       this.dmc._parent[this.dmc._name + "_txt"]._visible = false;
  16.       this.dmc.onRelease = function()
  17.       {
  18.          cref.Show(true);
  19.          cref.game.listenForKeys = true;
  20.       };
  21.       this.dmc._parent[this.dmc._name + "_txt"].onRelease = function()
  22.       {
  23.          cref.game.listenForKeys = true;
  24.          this._visible = false;
  25.       };
  26.       this.ob = new Object();
  27.       this.ob.onKeyDown = function()
  28.       {
  29.          if(Key.getCode() == 88)
  30.          {
  31.             if(cref.dmc._parent[cref.dmc._name + "_txt"]._visible == true)
  32.             {
  33.                cref.dmc._parent[cref.dmc._name + "_txt"]._visible = false;
  34.                cref.game.listenForKeys = true;
  35.             }
  36.          }
  37.       };
  38.       Key.addListener(this.ob);
  39.    }
  40.    function Show(showAlways)
  41.    {
  42.       if(!this.helpShown || showAlways)
  43.       {
  44.          this.helpShown = true;
  45.          this.rec.setActiveState(false);
  46.       }
  47.       this.dmc._parent[this.dmc._name + "_txt"]._visible = true;
  48.       this.dmc._parent[this.dmc._name + "_txt"].onKeyDown = function()
  49.       {
  50.          trace("blaat");
  51.       };
  52.       this.game.listenForKeys = false;
  53.    }
  54. }
  55.