home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Games #12
/
GEGA012.iso
/
eroticos
/
spankthebooty.swf
/
scripts
/
__Packages
/
Hand.as
< prev
next >
Wrap
Text File
|
2005-10-13
|
2KB
|
74 lines
class Hand extends MovieClip
{
var dragging = false;
var oldx = 0;
var oldy = 0;
var oldt = 0;
function Hand()
{
var _loc1_ = this;
super();
_loc1_.startx = _loc1_._x;
_loc1_.starty = _loc1_._y;
_loc1_.setFrame();
}
function show()
{
var _loc1_ = this;
_loc1_._x = _loc1_.startx;
_loc1_._y = _loc1_.starty;
_loc1_.setFrame();
_loc1_._visible = true;
}
function hide()
{
this._visible = false;
}
function onPress()
{
var _loc1_ = this;
_loc1_.dragging = true;
_loc1_.oldx = _loc1_._x = _loc1_._parent._xmouse;
_loc1_.oldy = _loc1_._y = _loc1_._parent._ymouse;
_loc1_.oldt = getTimer();
}
function onRelease()
{
var _loc1_ = this;
_loc1_.dragging = false;
_loc1_._x = Math.min(Math.max(_loc1_._x,-350),350);
_loc1_._y = Math.min(Math.max(_loc1_._y,-175),175);
}
function onEnterFrame()
{
var _loc1_ = this;
if(_loc1_.dragging)
{
var x = _loc1_._x = _loc1_._parent._xmouse;
var y = _loc1_._y = _loc1_._parent._ymouse;
var _loc3_ = getTimer();
var _loc2_ = 33 * Math.sqrt(Math.pow(x - _loc1_.oldx,2) + Math.pow(y - _loc1_.oldy,2)) / (_loc3_ - _loc1_.oldt);
_loc1_.oldx = x;
_loc1_.oldy = y;
_loc1_.oldt = _loc3_;
_loc1_.setFrame();
_loc1_._parent.console_mc.setSpeed(_loc2_);
if(_loc2_ > 100)
{
SoundManager.swing();
}
if(_loc1_.hitTest(_loc1_._parent.hitarea_mc))
{
_loc1_.onRelease();
_loc1_._parent.wak(_loc2_);
}
}
}
function setFrame()
{
var _loc1_ = 5 + Math.ceil(this._x / 60);
_loc1_ = Math.min(Math.max(_loc1_,2),11);
this.gotoAndStop(_loc1_);
}
}