home *** CD-ROM | disk | FTP | other *** search
- class Scrollbar extends MovieClip
- {
- var Thumb;
- var iScroller;
- 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});
- }
- }
- }
-