home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Puzzle / Easter_Eggs.swf / scripts / __Packages / com / novelgames / flashgames / commonAS2 / NewButton.as < prev    next >
Text File  |  2008-09-04  |  3KB  |  117 lines

  1. class com.novelgames.flashgames.commonAS2.NewButton extends Button
  2. {
  3.    function NewButton()
  4.    {
  5.       super();
  6.    }
  7.    function set x(x)
  8.    {
  9.       this._x = x;
  10.    }
  11.    function get x()
  12.    {
  13.       return this._x;
  14.    }
  15.    function set y(y)
  16.    {
  17.       this._y = y;
  18.    }
  19.    function get y()
  20.    {
  21.       return this._y;
  22.    }
  23.    function set mouseX(mouseX)
  24.    {
  25.       this._xmouse = mouseX;
  26.    }
  27.    function get mouseX()
  28.    {
  29.       return this._xmouse;
  30.    }
  31.    function set mouseY(mouseY)
  32.    {
  33.       this._ymouse = mouseY;
  34.    }
  35.    function get mouseY()
  36.    {
  37.       return this._ymouse;
  38.    }
  39.    function set visible(visible)
  40.    {
  41.       this._visible = visible;
  42.    }
  43.    function get visible()
  44.    {
  45.       return this._visible;
  46.    }
  47.    function set alpha(alpha)
  48.    {
  49.       this._alpha = alpha * 100;
  50.    }
  51.    function get alpha()
  52.    {
  53.       return this._alpha / 100;
  54.    }
  55.    function get name()
  56.    {
  57.       return this._name;
  58.    }
  59.    function addEventListener(type, listenerObject, listenerFunctionName)
  60.    {
  61.       switch(type)
  62.       {
  63.          case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK:
  64.             this.onRelease = function()
  65.             {
  66.                listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
  67.             };
  68.             break;
  69.          case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER:
  70.             this.onRollOver = function()
  71.             {
  72.                listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
  73.             };
  74.             break;
  75.          case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT:
  76.             this.onRollOut = function()
  77.             {
  78.                listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
  79.             };
  80.             break;
  81.          case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN:
  82.             this.onPress = function()
  83.             {
  84.                listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
  85.             };
  86.             break;
  87.          case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP:
  88.             this.onRelease = function()
  89.             {
  90.                listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
  91.             };
  92.             this.onReleaseOutside = this.onRelease;
  93.       }
  94.    }
  95.    function removeEventListener(type)
  96.    {
  97.       switch(type)
  98.       {
  99.          case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK:
  100.             this.onRelease = null;
  101.             break;
  102.          case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER:
  103.             this.onRollOver = null;
  104.             break;
  105.          case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT:
  106.             this.onRollOut = null;
  107.             break;
  108.          case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN:
  109.             this.onPress = null;
  110.             break;
  111.          case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP:
  112.             this.onRelease = null;
  113.             this.onReleaseOutside = null;
  114.       }
  115.    }
  116. }
  117.