Kenneth, thanks so much for your help - i decided to give it a go and try to code my own scrollbar application.
It worked out quite well, however, I have one last question. I have gotten the up & down arrows to work. The scrollFace to work, but simply am missing the scrollface on drag data. I am not sure how to make the scrollFace reach the bottom at the same time content Main does. I will post my code & would appreciate any assistance. I know exactly where the code help I need should be placed & have commented as such. Here is the code: Any help would be appreciated by anyone:
//following is scrollBar code - change all "_root." to the path of this .swf if .swf is dynamically loaded//
scrollBar = function () {
initialy = _root.contentMain._y;
bottomy = -300; //this # needs to be hard-coded, dependent on the final y value of contentMain you want when you press the downbutton//
increment = 5; //number of units that content Main moves on either up or down arrow press//
units = (Math.abs(initialy - bottomy)) / increment; //used for further calculation;
_root.attachMovie("upbutton", "upbutton", 2004);
this.upbutton._x = 570;
this.upbutton._y = 55;
_root.attachMovie("downbutton", "downbutton", 2005);
this.downbutton._x = 570;
this.downbutton._y = 340;
_root.attachMovie("scrollTrack", "scrollTrack", 2002);
yvalue = this.upbutton._y + this.upbutton._height; //for getting y & height values
this.scrollTrack._width = this.upbutton._width - 4; //creating width - 4 smaller than buttons//
this.scrollTrack._x = this.upbutton._x + 2; //creating x location - centered on up button/
this.scrollTrack._y = yvalue; //creating y value = up button y + up button height.
this.scrollTrack._height = this.downbutton._y - yvalue; //the space between up & down buttons//
_root.attachMovie("scrollFace", "scrollFace", 2003);
this.scrollFace._x = this.scrollTrack._x + 1;
this.scrollFace._y = this.scrollTrack._y;
sfunits = this.scrollTrack._height - this.scrollFace._height;
//this variable is listed here becuase they hadn't been substantiated yet//
sfincrement = sfunits / units; //number of units that scrollFace moves on either up or down arrow press//
// up button code//
this.upbutton.onPress = function (){
this.onEnterFrame = function() {
if (_root.contentMain._y > initialy) {
donothing;}
else if (_root.contentMain._y < initialy) {
this._parent.contentMain._y = this._parent.contentMain._y + increment;
if(this._parent.scrollFace._y < this._parent.scrollTrack._y) {
donothing;}
else if(this._parent.scrollFace._y > this._parent.scrollTrack._y) {
this._parent.scrollFace._y = this._parent.scrollFace._y - sfincrement;
}}}}
this.upbutton.onRelease = function() { //so stops scrolling
delete this.onEnterFrame;}
this.upbutton.onDragOut = function() { //so stops scrolling
delete this.onEnterFrame;}
//down button code//
this.downbutton.onPress = function() {
this.onEnterFrame = function() {
if (_root.contentMain._y < bottomy) {
donothing; }
else if (_root.contentMain._y > bottomy) {
this._parent.contentMain._y = this._parent.contentMain._y - increment;
if(this._parent.scrollFace._y > this._parent.downbutton._y - this._parent.scrollFace._height) {
donothing;}
else if(this._parent.scrollFace._y < this._parent.downbutton._y - this._parent.scrollFace._height) {
this._parent.scrollFace._y = this._parent.scrollFace._y + sfincrement;
}}}}
this.downbutton.onRelease = function() { //so stops scrolling
delete this.onEnterFrame;}
this.downbutton.onDragOut = function() { //so stops scrolling
delete this.onEnterFrame;}
//scrollFace Drag Code//
this.scrollFace.onPress = function() {
var currPos:Number = this._y;
var top = this._parent.scrollTrack._y
var bottom = this._parent.downbutton._y - this._parent.scrollFace._height
startDrag(this, false, this._x, top, this._x, bottom);
this.onMouseMove = function() {
sfy = scrollFace._y;
cmy = contentMain._y;
//what code should be here so that I can drag the scrollFace to the bottom and
//contentMain will be at the bottom, etc.//
}
}
this.scrollFace.onMouseUp = function() {
stopDrag();
delete this.onMouseMove;
};
}
scrollBar();
Also, you can download at
scrollbar code is on frame 2 in actions layer.
Thank so much for all previous help on this forum.
Jonathan