class Slider_ extends MovieClip { var drag, _parent, _xmouse, bg, count, __get__scrollPosition, _nOffset, _nPrevScroll, dispatchEvent, __set__scrollPosition; function Slider_() { super(); mx.events.EventDispatcher.initialize(this); drag.useHandCursor = false; drag.onPress = function () { _parent._nOffset = _xmouse; _parent._nInterval = setInterval(_parent, "scroll", 20); }; drag.onRelease = function () { clearInterval(_parent._nInterval); }; drag.onReleaseOutside = drag.onRelease; bg.useHandCursor = false; bg.onRelease = function () { var _loc2 = _parent._xmouse - _parent.drag._width / 2; if (_loc2 < 0) { _loc2 = 0; } else if (_loc2 > 100) { _loc2 = 100; } // end else if _parent.drag._x = _loc2; _parent.count.txt.text = _parent.scrollPosition; _parent.dispatchEvent({type: "change", target: _parent}); }; count.txt.text = scrollPosition; } // End of the function function set scrollPosition(nScrollPosition) { if (nScrollPosition > _nMax) { return; } // end if _nScrollPosition = nScrollPosition; drag._x = (nScrollPosition - _nMin) / (_nMax - _nMin) * (bg._width - drag._width) + bg._x; count.txt.text = nScrollPosition; //return (this.scrollPosition()); null; } // End of the function function get scrollPosition() { var _loc2 = (drag._x - bg._x) / (bg._width - drag._width) * (_nMax - _nMin) + _nMin; return (Math.round(_loc2)); } // End of the function function scroll() { var _loc2 = _xmouse - _nOffset; var _loc4 = 0; var _loc3 = bg._width - drag._width; if (_loc2 > _loc4 && _loc2 < _loc3) { drag._x = _xmouse - _nOffset; } else if (_loc2 < _loc4) { drag._x = _loc4; } else if (_loc2 > _loc3) { drag._x = _loc3; } // end else if this.dispatchScrollEvent(); updateAfterEvent(); } // End of the function function dispatchScrollEvent() { if (drag._x != _nPrevScroll) { this.dispatchEvent({type: "change", target: this}); _nPrevScroll = int(drag._x); count.txt.text = scrollPosition; } // end if } // End of the function function tack() { } // End of the function var _nMax = 100; var _nMin = 0; var _nScrollPosition = 0; } // End of Class