Tutorial Problems

I have been following this tutorial for the scroll bar in flash

http://www.kirupa.com/developer/flash8/scrollbar.htm

I use my own sizes and images etc, but named the correctly. And edited the code to any names the ‘demo’ code didn’t use.
Now the code itself has no errors, phyiscly.

The problems come when running it. The scroll bar cant work will not work correctly. And also the text does not scroll. From what i read, i could use the same ‘demo’ code and the variables would automacticly pick up the X,Y vaules. Height and width etc. Although i am assuming this is incorrect because the scroll bar should work.
to give you a better idea of my problem i have uploaded the flash file.
as of yet the preloader isn’t up. So it might take a few seconds to load :wink:

http://www.toxicmage.org/flashtest.html

As you can see i just typed random letters so i could test the scroll bar. The random letters go down a looooooong way, by the way. Wanted to test it good :smiley:

Ok i decided to still use my own graphics but not actually build it into the website. I used the exact names and followed what it said.
The text now scrolls kind of…it cuts a lot off. And i cant understand why the scroll face is always starting the middle of the scroll bar. Even though i place it at the top.

Example here:
http://www.toxicmage.org/scrolltestv2.html

I will copy the code i used into here so you dont need to scan the tutorial for it

scrolling = function () {

var scrollHeight:Number = scrollTrack._height;
var contentHeight:Number = contentMain._height;
var scrollFaceHeight:Number = scrollFace._height;
var maskHeight:Number = maskedView._height;
var initPosition:Number = scrollFace._y=scrollTrack._y;
var initContentPos:Number = contentMain._y;
var finalContentPos:Number = maskHeight-contentHeight+initContentPos;
var left:Number = scrollTrack._x;
var top:Number = scrollTrack._y;
var right:Number = scrollTrack._x;
var bottom:Number = scrollTrack._height-scrollFaceHeight+scrollTrack._y;
var dy:Number = 0;
var speed:Number = 10;
var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight);

scrollFace.onPress = function() {

var currPos:Number = this._y;
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function() {

dy = Math.abs(initPosition-this._y);
contentMain._y = Math.round(dy*-1*moveVal+initContentPos);

};

};
scrollFace.onMouseUp = function() {

stopDrag();
delete this.onMouseMove;

};
btnUp.onPress = function() {

this.onEnterFrame = function() {

if (contentMain._y+speed<maskedView._y) {

if (scrollFace._y<=top) {

scrollFace._y = top;

} else {

scrollFace._y -= speed/moveVal;

}
contentMain._y += speed;

} else {

scrollFace._y = top;
contentMain._y = maskedView._y;
delete this.onEnterFrame;

}

};

};
btnUp.onDragOut = function() {

delete this.onEnterFrame;

};
btnUp.onMouseOut = function() {

delete this.onEnterFrame;

};
btnDown.onPress = function() {

this.onEnterFrame = function() {

if (contentMain._y-speed>finalContentPos) {

if (scrollFace._y>=bottom) {

scrollFace._y = bottom;

} else {

scrollFace._y += speed/moveVal;

}
contentMain._y -= speed;

} else {

scrollFace._y = bottom;
contentMain._y = finalContentPos;
delete this.onEnterFrame;

}

};

};
btnDown.onRelease = function() {

delete this.onEnterFrame;

};
btnDown.onDragOut = function() {

delete this.onEnterFrame;

};

if (contentHeight<maskHeight) {

scrollFace._visible = false;
btnUp.enabled = false;
btnDown.enabled = false;

} else {

scrollFace._visible = true;
btnUp.enabled = true;
btnDown.enabled = true;

}

};
scrolling();