自制滚动条(2) inc = int(Math.abs(this.max-this.min)/myText.maxscroll);};scrollBar.onPress = function() { //當滾動條被點下的時候this.startDrag(false, this._x, this.min, this._x, this.max); //根據上方定義的變量賦予滾動條的拖拉範圍this.onEnterFrame = function() { //拖拉時循環決定文本的滾動myText.scroll = int(scrollBar._y/inc);};};scrollBar.onRelease = function() { //滾動條放開的時候this.stopDrag(); //停止拖拉delete this.onEnterFrame; //刪除循環以釋放資源的占用};scrollBar.initial(); //開始定義 就這樣而已... 很簡單吧... 如果有興趣的朋友可以進一步的增加功能