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 >
Wrap
Text File
|
2008-09-04
|
3KB
|
117 lines
class com.novelgames.flashgames.commonAS2.NewButton extends Button
{
function NewButton()
{
super();
}
function set x(x)
{
this._x = x;
}
function get x()
{
return this._x;
}
function set y(y)
{
this._y = y;
}
function get y()
{
return this._y;
}
function set mouseX(mouseX)
{
this._xmouse = mouseX;
}
function get mouseX()
{
return this._xmouse;
}
function set mouseY(mouseY)
{
this._ymouse = mouseY;
}
function get mouseY()
{
return this._ymouse;
}
function set visible(visible)
{
this._visible = visible;
}
function get visible()
{
return this._visible;
}
function set alpha(alpha)
{
this._alpha = alpha * 100;
}
function get alpha()
{
return this._alpha / 100;
}
function get name()
{
return this._name;
}
function addEventListener(type, listenerObject, listenerFunctionName)
{
switch(type)
{
case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK:
this.onRelease = function()
{
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER:
this.onRollOver = function()
{
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT:
this.onRollOut = function()
{
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN:
this.onPress = function()
{
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP:
this.onRelease = function()
{
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
this.onReleaseOutside = this.onRelease;
}
}
function removeEventListener(type)
{
switch(type)
{
case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK:
this.onRelease = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER:
this.onRollOver = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT:
this.onRollOut = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN:
this.onPress = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP:
this.onRelease = null;
this.onReleaseOutside = null;
}
}
}