home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / climatechaos.swf / scripts / __Packages / Person.as < prev    next >
Encoding:
Text File  |  2008-09-12  |  1.6 KB  |  76 lines

  1. class Person extends Position
  2. {
  3.    var p;
  4.    var description;
  5.    var onRelease;
  6.    var environment;
  7.    var speech;
  8.    var photo_name;
  9.    var onRollOver;
  10.    var onRollOut;
  11.    var nx;
  12.    var z;
  13.    var offscreen;
  14.    var ny;
  15.    var zs;
  16.    function Person()
  17.    {
  18.       super();
  19.       this.p.cacheAsBitmap = true;
  20.       this.description = "";
  21.       this.onRelease = function()
  22.       {
  23.          if(this.distanceTo(this.environment.pos_x,this.environment.pos_y) < 40)
  24.          {
  25.             this.unDescribe();
  26.             this.speech(this.environment,this.photo_name);
  27.          }
  28.       };
  29.       this.onRollOver = function()
  30.       {
  31.          this.describe();
  32.       };
  33.       this.onRollOut = function()
  34.       {
  35.          this.unDescribe();
  36.       };
  37.    }
  38.    function setSpeech(p_speech)
  39.    {
  40.       this.speech = p_speech;
  41.    }
  42.    function describe()
  43.    {
  44.       var _loc3_ = this.description;
  45.       if(this.distanceTo(this.environment.pos_x,this.environment.pos_y) < 40)
  46.       {
  47.          _loc3_ = "Talk to " + _loc3_;
  48.       }
  49.       _root.hud.setText(_loc3_);
  50.    }
  51.    function unDescribe()
  52.    {
  53.       _root.hud.setText("");
  54.    }
  55.    function render(p_env)
  56.    {
  57.       this.posit(p_env);
  58.       if(this.nx < 650 && this.nx > -100 && this.z > -400)
  59.       {
  60.          this.offscreen = false;
  61.          this._x = this.nx;
  62.          this._y = this.ny;
  63.          this._xscale = this._yscale = 40 * this.zs;
  64.          this.depth();
  65.          this.blur(this.ny);
  66.          this.fade();
  67.       }
  68.       else if(this.offscreen == false)
  69.       {
  70.          this.offscreen = true;
  71.          this._x = -200;
  72.          this._y = -200;
  73.       }
  74.    }
  75. }
  76.