home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
404 Jogos
/
CLJG.iso
/
Esportes
/
CrossingCup.swf
/
scripts
/
__Packages
/
Scrollbar.as
< prev
next >
Wrap
Text File
|
2007-12-11
|
2KB
|
67 lines
class Scrollbar extends MovieClip
{
var tumbheight = 387;
function Scrollbar()
{
super();
if(this._name == "horz")
{
this.Thumb.onMouseDown = function()
{
if(this.hitTest(_root._xmouse,_root._ymouse,true))
{
this.startDrag(true,409,0,20,0);
this.iScroller = setInterval(this._parent.mouseMovement,5,this._parent);
}
};
}
else
{
this.Thumb.onMouseDown = function()
{
if(this.hitTest(_root._xmouse,_root._ymouse,true))
{
this.startDrag(true,0,387);
this.iScroller = setInterval(this._parent.mouseMovement,5,this._parent);
}
};
}
this.Thumb.onMouseUp = function()
{
this.stopDrag();
clearInterval(this.iScroller);
};
}
function mouseMovement(_this)
{
if(_this._name == "horz")
{
var _loc3_ = _this.Thumb._x - 20;
if(_loc3_ < 0)
{
_loc3_ = 0;
}
if(_loc3_ > 409)
{
_loc3_ = 409;
}
var _loc6_ = _loc3_ / 387 * 100;
_global.__DISPATCH({type:"thumbMovement",param:_loc6_,horz:true});
}
else
{
var _loc2_ = _this.Thumb._y;
if(_loc2_ < 0)
{
_loc2_ = 0;
}
if(_loc2_ > 387)
{
_loc2_ = 387;
}
var _loc5_ = _loc2_ / 387 * 100;
_global.__DISPATCH({type:"thumbMovement",param:_loc5_,horz:false});
}
}
}